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

Unified Diff: ui/keyboard/keyboard_util.h

Issue 20145004: Switch from text insertion to key press and release events on the virtual k… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk. Created 7 years, 3 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 | « ui/keyboard/keyboard_ui_handler.cc ('k') | ui/keyboard/keyboard_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_util.h
diff --git a/ui/keyboard/keyboard_util.h b/ui/keyboard/keyboard_util.h
index 7d4643335c9ee4c802b36f6fb192e772d8712910..bb0edfb7bd7678c956f96ea2ad62a519f0e98805 100644
--- a/ui/keyboard/keyboard_util.h
+++ b/ui/keyboard/keyboard_util.h
@@ -29,7 +29,7 @@ enum CursorMoveDirection {
KEYBOARD_EXPORT bool IsKeyboardEnabled();
// Insert |text| into the active TextInputClient associated with |root_window|,
-// if there is one. Returns true if |text| was successfully inserted. Note
+// if there is one. Returns true if |text| was successfully inserted. Note
// that this may convert |text| into ui::KeyEvents for injection in some
// special circumstances (i.e. VKEY_RETURN, VKEY_BACK).
KEYBOARD_EXPORT bool InsertText(const base::string16& text,
@@ -41,7 +41,18 @@ KEYBOARD_EXPORT bool MoveCursor(int swipe_direction,
int modifier_flags,
aura::RootWindow* root_window);
-// Get the list of keyboard resources. |size| is populated with the number of
+// Sends a fabricated key event, where |type| is the event type, |key_value|
+// is the unicode value of the character, |key_code| is the legacy key code
+// value, and |shift_modifier| indicates if the shift key is being virtually
+// pressed. The event is dispatched to the active TextInputClient associated
+// with |root_window|. The type may be "keydown" or "keyup".
+KEYBOARD_EXPORT bool SendKeyEvent(std::string type,
+ int key_value,
+ int key_code,
+ bool shift_modifier,
+ aura::RootWindow* root_window);
+
+// Get the list of keyboard resources. |size| is populated with the number of
// resources in the returned array.
KEYBOARD_EXPORT const GritResourceMap* GetKeyboardExtensionResources(
size_t* size);
« no previous file with comments | « ui/keyboard/keyboard_ui_handler.cc ('k') | ui/keyboard/keyboard_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698