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 #include "ui/events/ozone/evdev/input_controller_evdev.h" | 5 #include "ui/events/ozone/evdev/input_controller_evdev.h" |
6 | 6 |
7 #include <linux/input.h> | 7 #include <linux/input.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/events/ozone/evdev/input_device_factory_evdev.h" | 10 #include "ui/events/ozone/evdev/input_device_factory_evdev.h" |
11 #include "ui/events/ozone/evdev/keyboard_evdev.h" | 11 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
12 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h" | 12 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 | 15 |
16 InputControllerEvdev::InputControllerEvdev(KeyboardEvdev* keyboard, | 16 InputControllerEvdev::InputControllerEvdev(KeyboardEvdev* keyboard, |
17 MouseButtonMapEvdev* button_map) | 17 MouseButtonMapEvdev* button_map) |
18 : input_device_factory_(nullptr), | 18 : input_device_factory_(nullptr), |
19 keyboard_(keyboard), | 19 keyboard_(keyboard), |
20 button_map_(button_map) { | 20 button_map_(button_map), |
21 has_mouse_(false), | |
22 has_touchpad_(false) { | |
21 } | 23 } |
22 | 24 |
23 InputControllerEvdev::~InputControllerEvdev() { | 25 InputControllerEvdev::~InputControllerEvdev() { |
24 } | 26 } |
25 | 27 |
26 void InputControllerEvdev::SetInputDeviceFactory( | 28 void InputControllerEvdev::SetInputDeviceFactory( |
27 InputDeviceFactoryEvdev* input_device_factory) { | 29 InputDeviceFactoryEvdev* input_device_factory) { |
28 input_device_factory_ = input_device_factory; | 30 input_device_factory_ = input_device_factory; |
29 } | 31 } |
30 | 32 |
33 void InputControllerEvdev::SetHasMouse(bool has_mouse) { | |
alexst (slow to review)
2015/01/28 16:16:44
should_this_be_hacker_style()?
Here and for all t
spang
2015/01/28 19:04:54
Will change as a followup, don't want to add a lar
| |
34 has_mouse_ = has_mouse; | |
35 } | |
36 | |
37 void InputControllerEvdev::SetHasTouchpad(bool has_touchpad) { | |
38 has_touchpad_ = has_touchpad; | |
39 } | |
40 | |
31 bool InputControllerEvdev::HasMouse() { | 41 bool InputControllerEvdev::HasMouse() { |
32 if (!input_device_factory_) | 42 return has_mouse_; |
33 return false; | |
34 return input_device_factory_->HasMouse(); | |
35 } | 43 } |
36 | 44 |
37 bool InputControllerEvdev::HasTouchpad() { | 45 bool InputControllerEvdev::HasTouchpad() { |
38 if (!input_device_factory_) | 46 return has_touchpad_; |
39 return false; | |
40 return input_device_factory_->HasTouchpad(); | |
41 } | 47 } |
42 | 48 |
43 bool InputControllerEvdev::IsCapsLockEnabled() { | 49 bool InputControllerEvdev::IsCapsLockEnabled() { |
44 return false; | 50 return false; |
45 } | 51 } |
46 | 52 |
47 void InputControllerEvdev::SetCapsLockEnabled(bool enabled) { | 53 void InputControllerEvdev::SetCapsLockEnabled(bool enabled) { |
48 NOTIMPLEMENTED(); | 54 NOTIMPLEMENTED(); |
49 } | 55 } |
50 | 56 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 button_map_->UpdateButtonMap(BTN_LEFT, right ? BTN_RIGHT : BTN_LEFT); | 132 button_map_->UpdateButtonMap(BTN_LEFT, right ? BTN_RIGHT : BTN_LEFT); |
127 button_map_->UpdateButtonMap(BTN_RIGHT, right ? BTN_LEFT : BTN_RIGHT); | 133 button_map_->UpdateButtonMap(BTN_RIGHT, right ? BTN_LEFT : BTN_RIGHT); |
128 } | 134 } |
129 | 135 |
130 void InputControllerEvdev::SetTapToClickPaused(bool state) { | 136 void InputControllerEvdev::SetTapToClickPaused(bool state) { |
131 if (input_device_factory_) | 137 if (input_device_factory_) |
132 input_device_factory_->SetTapToClickPaused(state); | 138 input_device_factory_->SetTapToClickPaused(state); |
133 } | 139 } |
134 | 140 |
135 } // namespace ui | 141 } // namespace ui |
OLD | NEW |