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

Unified Diff: webkit/api/src/mac/WebInputEventFactory.mm

Issue 150206: Implement the NSTextInput protocol.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/api/public/mac/WebInputEventFactory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/mac/WebInputEventFactory.mm
===================================================================
--- webkit/api/src/mac/WebInputEventFactory.mm (revision 22136)
+++ webkit/api/src/mac/WebInputEventFactory.mm (working copy)
@@ -846,7 +846,7 @@
WebKeyboardEvent result;
result.type =
- isKeyUpEvent(event) ? WebInputEvent::KeyUp : WebInputEvent::KeyDown;
+ isKeyUpEvent(event) ? WebInputEvent::KeyUp : WebInputEvent::RawKeyDown;
result.modifiers = modifiersFromEvent(event);
@@ -905,6 +905,25 @@
return result;
}
+WebKeyboardEvent WebInputEventFactory::keyboardEvent(wchar_t character,
+ int modifiers,
+ double timeStampSeconds)
+{
+ // keyboardEvent(NSEvent*) depends on the NSEvent object and
+ // it is hard to use it from methods of the NSTextInput protocol. For
+ // such methods, this function creates a WebInputEvent::Char event without
+ // using a NSEvent object.
+ WebKeyboardEvent result;
+ result.type = WebKit::WebInputEvent::Char;
+ result.timeStampSeconds = timeStampSeconds;
+ result.modifiers = modifiers;
+ result.windowsKeyCode = character;
+ result.nativeKeyCode = character;
+ result.text[0] = character;
+ result.unmodifiedText[0] = character;
+ return result;
+}
+
// WebMouseEvent --------------------------------------------------------------
WebMouseEvent WebInputEventFactory::mouseEvent(NSEvent* event, NSView* view)
« no previous file with comments | « webkit/api/public/mac/WebInputEventFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698