| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ |
| 7 | 7 |
| 8 #include <bitset> | 8 #include <bitset> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 void ProcessEvents(const struct input_event* inputs, int count); | 49 void ProcessEvents(const struct input_event* inputs, int count); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 void ConvertKeyEvent(const input_event& input); | 52 void ConvertKeyEvent(const input_event& input); |
| 53 void ConvertMouseMoveEvent(const input_event& input); | 53 void ConvertMouseMoveEvent(const input_event& input); |
| 54 void OnKeyChange(unsigned int key, | 54 void OnKeyChange(unsigned int key, |
| 55 bool down, | 55 bool down, |
| 56 const base::TimeDelta& timestamp); | 56 const base::TimeDelta& timestamp); |
| 57 void ReleaseKeys(); | 57 void ReleaseKeys(); |
| 58 void ReleaseMouseButtons(); |
| 58 void OnLostSync(); | 59 void OnLostSync(); |
| 59 void DispatchMouseButton(const input_event& input); | 60 void DispatchMouseButton(const input_event& input); |
| 61 void OnButtonChange(int code, bool down, const base::TimeDelta& timestamp); |
| 60 | 62 |
| 61 // Flush events delimited by EV_SYN. This is useful for handling | 63 // Flush events delimited by EV_SYN. This is useful for handling |
| 62 // non-axis-aligned movement properly. | 64 // non-axis-aligned movement properly. |
| 63 void FlushEvents(const input_event& input); | 65 void FlushEvents(const input_event& input); |
| 64 | 66 |
| 65 // Input modalities for this device. | 67 // Input modalities for this device. |
| 66 bool has_keyboard_; | 68 bool has_keyboard_; |
| 67 bool has_touchpad_; | 69 bool has_touchpad_; |
| 68 | 70 |
| 69 // LEDs for this device. | 71 // LEDs for this device. |
| 70 bool has_caps_lock_led_; | 72 bool has_caps_lock_led_; |
| 71 | 73 |
| 72 // Save x-axis events of relative devices to be flushed at EV_SYN time. | 74 // Save x-axis events of relative devices to be flushed at EV_SYN time. |
| 73 int x_offset_; | 75 int x_offset_; |
| 74 | 76 |
| 75 // Save y-axis events of relative devices to be flushed at EV_SYN time. | 77 // Save y-axis events of relative devices to be flushed at EV_SYN time. |
| 76 int y_offset_; | 78 int y_offset_; |
| 77 | 79 |
| 78 // Controller for watching the input fd. | 80 // Controller for watching the input fd. |
| 79 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 81 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
| 80 | 82 |
| 81 // The evdev codes of the keys which should be blocked. | 83 // The evdev codes of the keys which should be blocked. |
| 82 std::bitset<KEY_CNT> blocked_keys_; | 84 std::bitset<KEY_CNT> blocked_keys_; |
| 83 | 85 |
| 84 // Pressed keys bitset. | 86 // Pressed keys bitset. |
| 85 std::bitset<KEY_CNT> key_state_; | 87 std::bitset<KEY_CNT> key_state_; |
| 86 | 88 |
| 89 // Last mouse button state. |
| 90 static const int kMouseButtonCount = BTN_JOYSTICK - BTN_MOUSE; |
| 91 std::bitset<kMouseButtonCount> mouse_button_state_; |
| 92 |
| 87 // Shared cursor state. | 93 // Shared cursor state. |
| 88 CursorDelegateEvdev* cursor_; | 94 CursorDelegateEvdev* cursor_; |
| 89 | 95 |
| 90 // Callbacks for dispatching events. | 96 // Callbacks for dispatching events. |
| 91 DeviceEventDispatcherEvdev* dispatcher_; | 97 DeviceEventDispatcherEvdev* dispatcher_; |
| 92 | 98 |
| 93 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl); | 99 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl); |
| 94 }; | 100 }; |
| 95 | 101 |
| 96 } // namespace ui | 102 } // namespace ui |
| 97 | 103 |
| 98 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ | 104 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ |
| 99 | 105 |
| OLD | NEW |