Explorar o código

providing socket info for keyboard events

Rodja Trappe %!s(int64=3) %!d(string=hai) anos
pai
achega
f59aee93c8
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      nicegui/elements/keyboard.py

+ 7 - 1
nicegui/elements/keyboard.py

@@ -55,7 +55,13 @@ class Keyboard(Element):
                 code=msg.key_data.code,
                 location=msg.key_data.location,
             )
-            arguments = KeyEventArguments(sender=self, action=action, modifiers=modifiers, key=key)
+            arguments = KeyEventArguments(
+                sender=self,
+                socket=msg.websocket,
+                action=action,
+                modifiers=modifiers,
+                key=key
+            )
             return handle_event(self.key_handler, arguments, update=self.parent_view)
         except Exception:
             traceback.print_exc()