1.[VD]Fix wrong key issue
The keys after IME filtered, WebEngine can only receive text on
callback, then WebEngine make fake key event with the text;
compared with the original key event, the fake event lost many
key properties(such as without the modifiers).
If get the DomKey from DomCode, will get wrong key,such as:
input uppercase letter "A" with IME, the key of key up event is lowercase key "a";
input "+" with IME, the key of key up event is "=".
So keep same with M94, if there is no key value, return empty directly,
don't get the DomKey from DomCode, for avoid getting wrong key value.
2.[EFL] Fix wrong text and wrong unmodifiedText issue
For EFL key event,keep same with M94, should get the text and unmodifiedText
from evt->string, not from evt->key.
On most case, the evt->string same with the evt->key;
but on some case, the evt->string may not same with the evt->key, such as:
when number lock, press the number key on the Numeric keypad area of the
usb-keboard, the evt->string is empty, it not same with the evt->key.
And press the number key when number lock, should not show the number.
Reference:
- https://archive.tizen.org/gerrit/310853/
Change-Id: Idde0d3803b1f75a37ba8d93bbccf36ac1a33b094
Signed-off-by: jiangyuwei <yuwei.jiang@samsung.com>
return device_scale_factor;
}
+static char16_t CharacterFromEflString(const char* string) {
+ if (string) {
+ std::u16string result;
+ base::UTF8ToUTF16(string, strlen(string), &result);
+ return result.length() == 1 ? result[0] : 0;
+ }
+
+ return 0;
+}
+
} // namespace
EflEventHandler::EflEventHandler(EflWindow* window)
base::TimeTicks::Now(), false);
#if BUILDFLAG(IS_EFL)
+ if (evt->string)
+ event.efl_character = CharacterFromEflString(evt->string);
+
event.text = event.GetText();
event.unmodified_text = event.GetUnmodifiedText();
#endif
}
DomKey KeyEvent::GetDomKey() const {
+#if BUILDFLAG(IS_TIZEN_TV)
+ return key_;
+#endif
+
// Determination of key_ may be done lazily.
if (key_ == DomKey::NONE)
ApplyLayout();
return 0;
#endif
+#if BUILDFLAG(IS_EFL)
+ return efl_character;
+#else
return GetCharacter();
+#endif
}
bool KeyEvent::IsUnicodeKeyCode() const {
bool is_system_key = false;
char16_t unmodified_text = 0xFFFF;
char16_t text = 0xFFFF;
+ char16_t efl_character = 0;
#endif
#if BUILDFLAG(IS_TIZEN_TV)