| Index: webkit/api/src/gtk/WebInputEventFactory.cpp
|
| ===================================================================
|
| --- webkit/api/src/gtk/WebInputEventFactory.cpp (版本 21138)
|
| +++ webkit/api/src/gtk/WebInputEventFactory.cpp (工作副本)
|
| @@ -190,6 +190,15 @@
|
| ASSERT_NOT_REACHED();
|
| }
|
|
|
| + // According to MSDN:
|
| + // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx
|
| + // Key events with Alt modifier and F10 are system key events.
|
| + // We just emulate this behavior. It's necessary to prevent webkit from
|
| + // processing keypress event generated by alt-d, etc.
|
| + // F10 is not special on Linux, so don't treat it as system key.
|
| + if (result.modifiers & WebInputEvent::AltKey)
|
| + result.isSystemKey = true;
|
| +
|
| // The key code tells us which physical key was pressed (for example, the
|
| // A key went down or up). It does not determine whether A should be lower
|
| // or upper case. This is what text does, which should be the keyval.
|
| @@ -207,6 +216,9 @@
|
| default:
|
| // This should set text to 0 when it's not a real character.
|
| // FIXME: fix for non BMP chars
|
| + // TODO(james.su@gmail.com):
|
| + // Support control characters input like Windows.
|
| + // See: http://en.wikipedia.org/wiki/Control_characters
|
| result.unmodifiedText[0] = result.text[0] =
|
| static_cast<WebUChar>(gdk_keyval_to_unicode(event->keyval));
|
| }
|
| @@ -233,6 +245,16 @@
|
| result.nativeKeyCode = character;
|
| result.text[0] = character;
|
| result.unmodifiedText[0] = character;
|
| +
|
| + // According to MSDN:
|
| + // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx
|
| + // Key events with Alt modifier and F10 are system key events.
|
| + // We just emulate this behavior. It's necessary to prevent webkit from
|
| + // processing keypress event generated by alt-d, etc.
|
| + // F10 is not special on Linux, so don't treat it as system key.
|
| + if (result.modifiers & WebInputEvent::AltKey)
|
| + result.isSystemKey = true;
|
| +
|
| return result;
|
| }
|
|
|
|
|