Chromium Code Reviews| 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/keyboard_evdev.h" | 5 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
| 6 | 6 |
| 7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
| 8 #include "ui/events/event_constants.h" | 8 #include "ui/events/event_constants.h" |
| 9 #include "ui/events/keycodes/dom4/keycode_converter.h" | 9 #include "ui/events/keycodes/dom4/keycode_converter.h" |
| 10 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" | 10 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 // State transition: !(down) -> (down) | 77 // State transition: !(down) -> (down) |
| 78 if (down) | 78 if (down) |
| 79 key_state_.set(key); | 79 key_state_.set(key); |
| 80 else | 80 else |
| 81 key_state_.reset(key); | 81 key_state_.reset(key); |
| 82 | 82 |
| 83 UpdateKeyRepeat(key, down); | 83 UpdateKeyRepeat(key, down); |
| 84 DispatchKey(key, down, false /* repeat */); | 84 DispatchKey(key, down, false /* repeat */); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void KeyboardEvdev::SetCapsLockEnabled(bool enabled) { | |
| 88 UpdateModifier(ui::EF_CAPS_LOCK_DOWN, enabled); | |
|
spang
2015/01/26 20:34:34
Don't think this is right. You probably need a new
kpschoedel
2015/01/27 17:12:48
Redone.
| |
| 89 } | |
| 90 | |
| 87 bool KeyboardEvdev::IsAutoRepeatEnabled() { | 91 bool KeyboardEvdev::IsAutoRepeatEnabled() { |
| 88 return repeat_enabled_; | 92 return repeat_enabled_; |
| 89 } | 93 } |
| 90 | 94 |
| 91 void KeyboardEvdev::SetAutoRepeatEnabled(bool enabled) { | 95 void KeyboardEvdev::SetAutoRepeatEnabled(bool enabled) { |
| 92 repeat_enabled_ = enabled; | 96 repeat_enabled_ = enabled; |
| 93 } | 97 } |
| 94 | 98 |
| 95 void KeyboardEvdev::SetAutoRepeatRate(const base::TimeDelta& delay, | 99 void KeyboardEvdev::SetAutoRepeatRate(const base::TimeDelta& delay, |
| 96 const base::TimeDelta& interval) { | 100 const base::TimeDelta& interval) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 } | 194 } |
| 191 | 195 |
| 192 // static | 196 // static |
| 193 int KeyboardEvdev::EvdevCodeToNativeCode(int evdev_code) { | 197 int KeyboardEvdev::EvdevCodeToNativeCode(int evdev_code) { |
| 194 if (evdev_code == KEY_RESERVED) | 198 if (evdev_code == KEY_RESERVED) |
| 195 return KeycodeConverter::InvalidNativeKeycode(); | 199 return KeycodeConverter::InvalidNativeKeycode(); |
| 196 return evdev_code + kXkbKeycodeOffset; | 200 return evdev_code + kXkbKeycodeOffset; |
| 197 } | 201 } |
| 198 | 202 |
| 199 } // namespace ui | 203 } // namespace ui |
| OLD | NEW |