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

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

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) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008 Collabora, Ltd. All rights reserved. 3 * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 int nativeVirtualKeyCode() const { return m_nativeVirtualKeyCode; } 84 int nativeVirtualKeyCode() const { return m_nativeVirtualKeyCode; }
85 85
86 bool isAutoRepeat() const { return getModifiers() & IsAutoRepeat; } 86 bool isAutoRepeat() const { return getModifiers() & IsAutoRepeat; }
87 bool isKeypad() const { return getModifiers() & IsKeyPad; } 87 bool isKeypad() const { return getModifiers() & IsKeyPad; }
88 bool isSystemKey() const { return m_isSystemKey; } 88 bool isSystemKey() const { return m_isSystemKey; }
89 89
90 PLATFORM_EXPORT static bool currentCapsLockState(); 90 PLATFORM_EXPORT static bool currentCapsLockState();
91 PLATFORM_EXPORT static Modifiers getCurrentModifierState(); 91 PLATFORM_EXPORT static Modifiers getCurrentModifierState();
92 92
93 // Returns accesskey activator used in page keyboard shortcuts in Chrome.
94 // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/a ccesskey.
95 PLATFORM_EXPORT static PlatformEvent::Modifiers accessKeyModifiers();
96
93 protected: 97 protected:
94 String m_text; 98 String m_text;
95 String m_unmodifiedText; 99 String m_unmodifiedText;
96 String m_keyIdentifier; 100 String m_keyIdentifier;
97 String m_code; 101 String m_code;
98 String m_key; 102 String m_key;
99 int m_windowsVirtualKeyCode; 103 int m_windowsVirtualKeyCode;
100 int m_nativeVirtualKeyCode; 104 int m_nativeVirtualKeyCode;
101 bool m_isSystemKey; 105 bool m_isSystemKey;
102 106
103 private: 107 private:
104 friend class Internals; 108 friend class Internals;
105 enum OverrideCapsLockState { 109 enum OverrideCapsLockState {
106 Default, 110 Default,
107 On, 111 On,
108 Off 112 Off
109 }; 113 };
110 // Allows overriding the current caps lock state for testing purposes. 114 // Allows overriding the current caps lock state for testing purposes.
111 PLATFORM_EXPORT static void setCurrentCapsLockState(OverrideCapsLockState st ate) { s_overrideCapsLockState = state; } 115 PLATFORM_EXPORT static void setCurrentCapsLockState(OverrideCapsLockState st ate) { s_overrideCapsLockState = state; }
112 PLATFORM_EXPORT static OverrideCapsLockState s_overrideCapsLockState; 116 PLATFORM_EXPORT static OverrideCapsLockState s_overrideCapsLockState;
113 }; 117 };
114 118
115 } // namespace blink 119 } // namespace blink
116 120
117 #endif // PlatformKeyboardEvent_h 121 #endif // PlatformKeyboardEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698