[M120 Migration][VD] Support usb keyboard special keys Wildcard Character 82/307482/3
authorfang fengrong <fr.fang@samsung.com>
Mon, 11 Mar 2024 03:09:43 +0000 (11:09 +0800)
committerYanqing Lu <yanqing.lu@samsung.com>
Wed, 13 Mar 2024 08:44:51 +0000 (08:44 +0000)
Some website("office 365") need use the keycode to distinguish the keys.
But now the special 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.

refer:
https://review.tizen.org/gerrit/#/c/301464

Change-Id: I5077b1238e0efaa929842ac6708df15bc2a0efe0
Signed-off-by: fang fengrong <fr.fang@samsung.com>
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_keycode_map.h
tizen_src/chromium_impl/ui/ozone/platform/efl/im_context_efl.cc

index 7c0e258..4d98157 100644 (file)
@@ -375,18 +375,41 @@ static ui::KeyboardCode UIKeyCodeFromEflKey(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 special 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.
index c1236a6..f4441fc 100644 (file)
@@ -495,6 +495,12 @@ void IMContextEfl::OnCommit(void* event_info) {
 
 void IMContextEfl::SendFakeCompositionKeyEvent(const std::u16string& buf) {
   std::string str = base::UTF16ToUTF8(buf);
+  // 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();