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

Side by Side Diff: third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp

Issue 2036643003: Creat a KeyboardEventManager class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google Inc. 3 * Copyright (C) 2008, 2009 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // happen to be in this range, e.g. the Apple logo (Option+Shift+K). 64 // happen to be in this range, e.g. the Apple logo (Option+Shift+K).
65 // 0xF7FF is an arbitrary cut-off. 65 // 0xF7FF is an arbitrary cut-off.
66 m_text = String(); 66 m_text = String();
67 m_unmodifiedText = String(); 67 m_unmodifiedText = String();
68 } 68 }
69 #endif 69 #endif
70 } 70 }
71 #endif 71 #endif
72 } 72 }
73 73
74 PlatformEvent::Modifiers PlatformKeyboardEvent::accessKeyModifiers()
75 {
76 // TODO(crbug.com/618397): Add a settings to control this behavior.
77 #if OS(MACOSX)
78 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
79 #else
80 return PlatformEvent::AltKey;
81 #endif
82 }
83
74 bool PlatformKeyboardEvent::currentCapsLockState() 84 bool PlatformKeyboardEvent::currentCapsLockState()
75 { 85 {
76 switch (s_overrideCapsLockState) { 86 switch (s_overrideCapsLockState) {
77 case OverrideCapsLockState::Default: 87 case OverrideCapsLockState::Default:
78 #if OS(WIN) 88 #if OS(WIN)
79 // FIXME: Does this even work inside the sandbox? 89 // FIXME: Does this even work inside the sandbox?
80 return GetKeyState(VK_CAPITAL) & 1; 90 return GetKeyState(VK_CAPITAL) & 1;
81 #elif OS(MACOSX) 91 #elif OS(MACOSX)
82 return GetCurrentKeyModifiers() & alphaLock; 92 return GetCurrentKeyModifiers() & alphaLock;
83 #else 93 #else
(...skipping 29 matching lines...) Expand all
113 if (currentModifiers & ::cmdKey) 123 if (currentModifiers & ::cmdKey)
114 modifiers |= MetaKey; 124 modifiers |= MetaKey;
115 #else 125 #else
116 // TODO(crbug.com/538289): Implement on other platforms. 126 // TODO(crbug.com/538289): Implement on other platforms.
117 return static_cast<Modifiers>(0); 127 return static_cast<Modifiers>(0);
118 #endif 128 #endif
119 return static_cast<Modifiers>(modifiers); 129 return static_cast<Modifiers>(modifiers);
120 } 130 }
121 131
122 } // namespace blink 132 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/PlatformKeyboardEvent.h ('k') | third_party/WebKit/Source/web/WebAXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698