Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: ui/events/ozone/evdev/keyboard_evdev.cc

Issue 878673004: Handle Caps Lock for Ozone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove spurious file Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/ozone/evdev/keyboard_evdev.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 modifiers_->SetModifierLock(EVDEV_MODIFIER_CAPS_LOCK, enabled);
89 }
90
91 bool KeyboardEvdev::IsCapsLockEnabled() {
92 return (modifiers_->GetModifierFlags() & EF_CAPS_LOCK_DOWN) != 0;
93 }
94
87 bool KeyboardEvdev::IsAutoRepeatEnabled() { 95 bool KeyboardEvdev::IsAutoRepeatEnabled() {
88 return repeat_enabled_; 96 return repeat_enabled_;
89 } 97 }
90 98
91 void KeyboardEvdev::SetAutoRepeatEnabled(bool enabled) { 99 void KeyboardEvdev::SetAutoRepeatEnabled(bool enabled) {
92 repeat_enabled_ = enabled; 100 repeat_enabled_ = enabled;
93 } 101 }
94 102
95 void KeyboardEvdev::SetAutoRepeatRate(const base::TimeDelta& delay, 103 void KeyboardEvdev::SetAutoRepeatRate(const base::TimeDelta& delay,
96 const base::TimeDelta& interval) { 104 const base::TimeDelta& interval) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 198 }
191 199
192 // static 200 // static
193 int KeyboardEvdev::EvdevCodeToNativeCode(int evdev_code) { 201 int KeyboardEvdev::EvdevCodeToNativeCode(int evdev_code) {
194 if (evdev_code == KEY_RESERVED) 202 if (evdev_code == KEY_RESERVED)
195 return KeycodeConverter::InvalidNativeKeycode(); 203 return KeycodeConverter::InvalidNativeKeycode();
196 return evdev_code + kXkbKeycodeOffset; 204 return evdev_code + kXkbKeycodeOffset;
197 } 205 }
198 206
199 } // namespace ui 207 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/keyboard_evdev.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698