Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2010-11-10 Evan Stade <estade@chromium.org>
        Reviewed by Tony Chang.

        [chromium] menu key doesn't work when capslock or numslock is on
        https://bugs.webkit.org/show_bug.cgi?id=49289

        Add a special bitmask for the "input" modifier keys (shift, alt, crtl, meta). The Modifier
        enum has grown to something that might be better termed State, but changing the nomenclature
        now is difficult. The bitmask gets its name from the related function getWebInputModifiers.

        * public/WebInputEvent.h: add InputModifiers mask for true modifier keys
        * src/WebViewImpl.cpp: disregard non-modifier keys
        (WebKit::WebViewImpl::keyEvent):

Canonical link: https://commits.webkit.org/62251@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71774 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Evan Stade committed Nov 10, 2010
1 parent 020a8eb commit 35cd03c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
15 changes: 15 additions & 0 deletions WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
2010-11-10 Evan Stade <estade@chromium.org>

Reviewed by Tony Chang.

[chromium] menu key doesn't work when capslock or numslock is on
https://bugs.webkit.org/show_bug.cgi?id=49289

Add a special bitmask for the "input" modifier keys (shift, alt, crtl, meta). The Modifier
enum has grown to something that might be better termed State, but changing the nomenclature
now is difficult. The bitmask gets its name from the related function getWebInputModifiers.

* public/WebInputEvent.h: add InputModifiers mask for true modifier keys
* src/WebViewImpl.cpp: disregard non-modifier keys
(WebKit::WebViewImpl::keyEvent):

2010-11-10 Csaba Osztrogonác <ossy@webkit.org>

Reviewed by David Hyatt.
Expand Down
2 changes: 2 additions & 0 deletions WebKit/chromium/public/WebInputEvent.h
Expand Up @@ -130,6 +130,8 @@ class WebInputEvent {
NumLockOn = 1 << 10,
};

static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey;

unsigned size; // The size of this structure, for serialization.
Type type;
int modifiers;
Expand Down
8 changes: 4 additions & 4 deletions WebKit/chromium/src/WebViewImpl.cpp
Expand Up @@ -571,13 +571,13 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event)
WebInputEvent::RawKeyDown;
#endif

if (((!event.modifiers && (event.windowsKeyCode == VKEY_APPS))
|| ((event.modifiers == WebInputEvent::ShiftKey) && (event.windowsKeyCode == VKEY_F10)))
&& event.type == contextMenuTriggeringEventType) {
bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers) && event.windowsKeyCode == VKEY_APPS;
bool isShiftF10 = event.modifiers == WebInputEvent::ShiftKey && event.windowsKeyCode == VKEY_F10;
if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeringEventType) {
sendContextMenuEvent(event);
return true;
}
#endif
#endif // OS(WINDOWS) || OS(LINUX) || OS(FREEBSD)

// It's not clear if we should continue after detecting a capslock keypress.
// I'll err on the side of continuing, which is the pre-existing behaviour.
Expand Down

0 comments on commit 35cd03c

Please sign in to comment.