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.h" | 5 #include "ui/events/event.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 | 10 |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 key_ = DomKey::UNIDENTIFIED; | 1220 key_ = DomKey::UNIDENTIFIED; |
1221 return; | 1221 return; |
1222 } | 1222 } |
1223 } | 1223 } |
1224 KeyboardCode dummy_key_code; | 1224 KeyboardCode dummy_key_code; |
1225 #if defined(OS_WIN) | 1225 #if defined(OS_WIN) |
1226 // Native Windows character events always have is_char_ == true, | 1226 // Native Windows character events always have is_char_ == true, |
1227 // so this is a synthetic or native keystroke event. | 1227 // so this is a synthetic or native keystroke event. |
1228 // Therefore, perform only the fallback action. | 1228 // Therefore, perform only the fallback action. |
1229 #elif defined(USE_X11) | 1229 #elif defined(USE_X11) |
1230 // When a control key is held, prefer ASCII characters to non ASCII | 1230 if (native_event()) { |
1231 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode | |
1232 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11. | |
1233 // GetCharacterFromXEvent returns 'à' in that case. | |
1234 if (!IsControlDown() && native_event()) { | |
1235 key_ = GetDomKeyFromXEvent(native_event()); | 1231 key_ = GetDomKeyFromXEvent(native_event()); |
1236 return; | 1232 return; |
1237 } | 1233 } |
1238 #elif defined(USE_OZONE) | 1234 #elif defined(USE_OZONE) |
1239 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup( | 1235 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup( |
1240 code, flags(), &key_, &dummy_key_code)) { | 1236 code, flags(), &key_, &dummy_key_code)) { |
1241 return; | 1237 return; |
1242 } | 1238 } |
1243 #else | 1239 #else |
1244 if (native_event()) { | 1240 if (native_event()) { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 flags | EF_FROM_TOUCH), | 1422 flags | EF_FROM_TOUCH), |
1427 details_(details), | 1423 details_(details), |
1428 unique_touch_event_id_(unique_touch_event_id) { | 1424 unique_touch_event_id_(unique_touch_event_id) { |
1429 latency()->set_source_event_type(ui::SourceEventType::TOUCH); | 1425 latency()->set_source_event_type(ui::SourceEventType::TOUCH); |
1430 } | 1426 } |
1431 | 1427 |
1432 GestureEvent::~GestureEvent() { | 1428 GestureEvent::~GestureEvent() { |
1433 } | 1429 } |
1434 | 1430 |
1435 } // namespace ui | 1431 } // namespace ui |
OLD | NEW |