[M94 Migration] Support usb keyboard special keys "~!@#$%^&*()_+`-={}|[]\:";'<>?,./" 90/302890/3
authorliuxd <xd123.liu@samsung.com>
Fri, 15 Dec 2023 05:52:20 +0000 (13:52 +0800)
committerBot Blink <blinkbot@samsung.com>
Mon, 18 Dec 2023 06:21:48 +0000 (06:21 +0000)
Some website("office 365") need use the keycode to distinguish the keys.
But now the specail keys haven't added on the map, the keycode is 0,
website can not distinguish the specail keys,
cause the keys which after these specail keys been lost when change line.

Add the usb keyboard keys "~!@#$%^&*()_+`-={}|[]\:";'<>?,./" on the
windows_key_codeFromEflKey  map.

Also covert " " to "space" key for avoid page scroll.

Ref: https://review.tizen.org/gerrit/c/301405

Change-Id: I08c8e6a8f95926a674251d074b169b5cbffcd43d
Signed-off-by: liuxd <xd123.liu@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/im_context_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/web_event_factory_efl.cc

index b35c704e1102629b35801daa3c4264d4e8017246..101e90080943408140b7f8ec787cba53f1235cfd 100644 (file)
@@ -664,6 +664,13 @@ void IMContextEfl::OnCommit(void* event_info) {
 void IMContextEfl::SendFakeCompositionKeyEvent(const std::u16string& buf) {
   std::string str = base::UTF16ToUTF8(buf);
 
+  // In some case, IME sends " "(white space) instead of keyname "space".
+  // We should process both " " and "space" which IME sends.
+  // Otherwise " " would be received by engine and cause unnecessary page
+  // scroll.
+  if (str == " ")
+    str = "space";
+
   Evas_Event_Key_Down downEvent;
   memset(&downEvent, 0, sizeof(Evas_Event_Key_Down));
   downEvent.key = str.c_str();
index 2b352a33c896632e4fda0e0c0b024123d0632cd6..03d591e0eeb3a8b069630540f0ceae72c4d343b7 100644 (file)
@@ -453,18 +453,41 @@ static ui::KeyboardCode windows_key_codeFromEflKey(const char* key) {
         {"Select", ui::VKEY_RETURN},
         {"Clear", ui::VKEY_DELETE},
 
-        // Support "+" "-" "*" "/" "," on the main keyboard zone of the USB keyboard:
-        // "+" ,"-","*","/" and "," delivered from EFL have key "plus","minus","asterisk",
-        // "slash","comma", that have already mapped to right keycode.
-        // But on TV all keys will go through IME,after processing of IME, the key changed
-        // from "plus","minus","asterisk","slash","comma" to "+" "-" "*" "/" ",".
-        // If "+" "-" "*" "/" "," have no map here, then their keycode will be 229,
-        // that will cause some website like office 365 excel check keycode failed.
-        {"+", ui::VKEY_OEM_PLUS},
-        {"-", ui::VKEY_OEM_MINUS},
-        {"*", ui::VKEY_8},
-        {"/", ui::VKEY_OEM_2},
-        {",", ui::VKEY_OEM_COMMA},
+        // Support all specail keys on physical keyboard
+        {"~", ui::VKEY_OEM_3},//asciitilde
+        {"`", ui::VKEY_OEM_3},//grave
+        {"!", ui::VKEY_1},//exclam
+        {"@", ui::VKEY_2},//at
+        {"#", ui::VKEY_3},//numbersign
+        {"$", ui::VKEY_4},//dollar
+        {"%", ui::VKEY_5},//percent
+        {"^", ui::VKEY_6},//asciicircum
+        {"&", ui::VKEY_7},//ampersand
+        {"*", ui::VKEY_8},//asterisk
+        {"(", ui::VKEY_9},//parenleft
+        {")", ui::VKEY_0},//parenright
+        {"_", ui::VKEY_OEM_MINUS},//underscore
+        {"-", ui::VKEY_OEM_MINUS},//minus
+        {"+", ui::VKEY_OEM_PLUS},//plus
+        {"=", ui::VKEY_OEM_PLUS},//equal
+
+        {"{", ui::VKEY_OEM_4},//braceleft
+        {"[", ui::VKEY_OEM_4},//bracketleft
+        {"}", ui::VKEY_OEM_6},//braceright
+        {"]", ui::VKEY_OEM_6},//bracketright
+        {"|", ui::VKEY_OEM_5},//bar
+        {"\\", ui::VKEY_OEM_5},//backslash
+
+        {":", ui::VKEY_OEM_1},//colon
+        {";", ui::VKEY_OEM_1},//semicolon
+        {"\"", ui::VKEY_OEM_7},//quotedbl
+        {"'", ui::VKEY_OEM_7},//apostrophe
+        {"<", ui::VKEY_OEM_COMMA},//less
+        {",", ui::VKEY_OEM_COMMA},//comma
+        {">", ui::VKEY_OEM_PERIOD},//greater
+        {".", ui::VKEY_OEM_PERIOD},//period
+        {"?", ui::VKEY_OEM_2},//question
+        {"/", ui::VKEY_OEM_2},//slash
 
         // The key value of the "Tab" is "ISO_Left_Tab" on "shift+ Tab" case.
         // Add "ISO_Left_Tab" mapping for supporting cell switch on Hancom Space Excel.