|
@@ -102,24 +102,6 @@ public:
|
|
|
CefEventHandle os_event,
|
|
CefEventHandle os_event,
|
|
|
bool* is_keyboard_shortcut) OVERRIDE
|
|
bool* is_keyboard_shortcut) OVERRIDE
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
- /*
|
|
|
|
|
-#ifdef ATOMIC_PLATFORM_OSX
|
|
|
|
|
-
|
|
|
|
|
- if (!event.native_key_code)
|
|
|
|
|
- return false;
|
|
|
|
|
-
|
|
|
|
|
- if (event.native_key_code == 36)
|
|
|
|
|
- {
|
|
|
|
|
- if (event.focus_on_editable_field && event.type != KEYEVENT_CHAR)
|
|
|
|
|
- return true;
|
|
|
|
|
-
|
|
|
|
|
- if (!event.focus_on_editable_field && event.type == KEYEVENT_CHAR)
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-#endif */
|
|
|
|
|
-
|
|
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -522,6 +504,9 @@ void WebClient::SendKeyEvent(const StringHash eventType, VariantMap& eventData)
|
|
|
|
|
|
|
|
#ifdef ATOMIC_PLATFORM_WINDOWS
|
|
#ifdef ATOMIC_PLATFORM_WINDOWS
|
|
|
|
|
|
|
|
|
|
+ // RETURN KEY: We need to send both keydown and char for return key
|
|
|
|
|
+ // this allows it to be used both to confirm entry on popups,
|
|
|
|
|
+ // while also being used for text input
|
|
|
if (keyEvent.windows_key_code == 13)
|
|
if (keyEvent.windows_key_code == 13)
|
|
|
{
|
|
{
|
|
|
keyEvent.type = KEYEVENT_CHAR;
|
|
keyEvent.type = KEYEVENT_CHAR;
|
|
@@ -531,31 +516,26 @@ void WebClient::SendKeyEvent(const StringHash eventType, VariantMap& eventData)
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ATOMIC_PLATFORM_OSX
|
|
#ifdef ATOMIC_PLATFORM_OSX
|
|
|
- // Send an empty key event on OSX, which seems to fix
|
|
|
|
|
- // keyboard problems on OSX with cefclient
|
|
|
|
|
- // ./cefclient --off-screen-rendering-enabled
|
|
|
|
|
- // return does not work at all on cef client with offscreen
|
|
|
|
|
- // bad interaction with arrow keys (for example here, after
|
|
|
|
|
- // hitting arrow keys, return/text takes a couple presses to register
|
|
|
|
|
|
|
|
|
|
|
|
+ // RETURN KEY: We need to send both keydown and char for return key
|
|
|
|
|
+ // this allows it to be used both to confirm entry on popups,
|
|
|
|
|
+ // while also being used for text input
|
|
|
if (keyEvent.native_key_code == 36)
|
|
if (keyEvent.native_key_code == 36)
|
|
|
{
|
|
{
|
|
|
keyEvent.type = KEYEVENT_CHAR;
|
|
keyEvent.type = KEYEVENT_CHAR;
|
|
|
host->SendKeyEvent(keyEvent);
|
|
host->SendKeyEvent(keyEvent);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //if (keyEvent.native_key_code == 125)
|
|
|
|
|
- //{
|
|
|
|
|
- // keyEvent.type = KEYEVENT_KEYUP;
|
|
|
|
|
- // host->SendKeyEvent(keyEvent);
|
|
|
|
|
- //}
|
|
|
|
|
|
|
+ // Send an empty key event on OSX, which seems to fix
|
|
|
|
|
+ // keyboard problems on OSX with cefclient
|
|
|
|
|
+ // ./cefclient --off-screen-rendering-enabled
|
|
|
|
|
+ // return does not work at all on cef client with offscreen
|
|
|
|
|
+ // bad interaction with arrow keys (for example here, after
|
|
|
|
|
+ // hitting arrow keys, return/text takes a couple presses to register
|
|
|
|
|
|
|
|
memset((void*)&keyEvent, 0, sizeof(keyEvent));
|
|
memset((void*)&keyEvent, 0, sizeof(keyEvent));
|
|
|
|
|
|
|
|
- if (eventType == "KeyDown")
|
|
|
|
|
- keyEvent.type = KEYEVENT_KEYDOWN;
|
|
|
|
|
- else
|
|
|
|
|
- keyEvent.type = KEYEVENT_KEYUP;
|
|
|
|
|
|
|
+ keyEvent.type = KEYEVENT_KEYDOWN;
|
|
|
keyEvent.modifiers = 0;
|
|
keyEvent.modifiers = 0;
|
|
|
keyEvent.native_key_code = 0;
|
|
keyEvent.native_key_code = 0;
|
|
|
host->SendKeyEvent(keyEvent);
|
|
host->SendKeyEvent(keyEvent);
|