Skip to content

Commit 223ca82

Browse files
committed
Update Kivy: handle special keys with kivy code -1
1 parent 638507a commit 223ca82

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/linux/binaries_64bit/kivy_.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ def on_key_down(self, keyboard, key, text, modifiers):
349349
# KEYEVENT_KEYUP = 2
350350
# KEYEVENT_CHAR = 3
351351

352+
# Kivy code -1 is a special key eg. Change keyboard layout.
353+
# Sending it to CEF would crash it.
354+
if key[0] == -1:
355+
return
356+
352357
# On escape release the keyboard, see the injected in OnLoadStart()
353358
if key[0] == 27:
354359
self.browser.GetFocusedFrame().ExecuteJavascript(
@@ -415,6 +420,11 @@ def on_key_up(self, keyboard, key):
415420
print("---- on_key_up")
416421
print("-- key="+str(key))
417422

423+
# Kivy code -1 is a special key eg. Change keyboard layout.
424+
# Sending it to CEF would crash it.
425+
if key[0] == -1:
426+
return
427+
418428
# CEF modifiers
419429
cef_modifiers = cefpython.EVENTFLAG_NONE
420430
if self.is_shift1 or self.is_shift2:

0 commit comments

Comments
 (0)