OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/event_constants.h" | 5 #include "ui/events/event_constants.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <X11/extensions/XInput.h> | 9 #include <X11/extensions/XInput.h> |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 case XI_KeyRelease: | 594 case XI_KeyRelease: |
595 // Build an XKeyEvent corresponding to the XI2 event, | 595 // Build an XKeyEvent corresponding to the XI2 event, |
596 // so that we can call XLookupString on it. | 596 // so that we can call XLookupString on it. |
597 InitXKeyEventFromXIDeviceEvent(*native_event, &xkey_from_xi2); | 597 InitXKeyEventFromXIDeviceEvent(*native_event, &xkey_from_xi2); |
598 xkey = &xkey_from_xi2.xkey; | 598 xkey = &xkey_from_xi2.xkey; |
599 break; | 599 break; |
600 default: | 600 default: |
601 NOTREACHED(); | 601 NOTREACHED(); |
602 break; | 602 break; |
603 } | 603 } |
| 604 break; |
604 } | 605 } |
605 default: | 606 default: |
606 NOTREACHED(); | 607 NOTREACHED(); |
607 break; | 608 break; |
608 } | 609 } |
609 KeySym keysym = XK_VoidSymbol; | 610 KeySym keysym = XK_VoidSymbol; |
610 if (xkey) | 611 if (xkey) |
611 XLookupString(xkey, NULL, 0, &keysym, NULL); | 612 XLookupString(xkey, NULL, 0, &keysym, NULL); |
612 return keysym; | 613 return keysym; |
613 } | 614 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 DeviceDataManagerX11::GetInstance()->GetGestureTimes( | 804 DeviceDataManagerX11::GetInstance()->GetGestureTimes( |
804 native_event, start_time, end_time); | 805 native_event, start_time, end_time); |
805 return true; | 806 return true; |
806 } | 807 } |
807 | 808 |
808 bool IsTouchpadEvent(const base::NativeEvent& event) { | 809 bool IsTouchpadEvent(const base::NativeEvent& event) { |
809 return DeviceDataManagerX11::GetInstance()->IsTouchpadXInputEvent(event); | 810 return DeviceDataManagerX11::GetInstance()->IsTouchpadXInputEvent(event); |
810 } | 811 } |
811 | 812 |
812 } // namespace ui | 813 } // namespace ui |
OLD | NEW |