浏览代码

providing socket info for keyboard events

Rodja Trappe 3 年之前
父节点
当前提交
f59aee93c8
共有 1 个文件被更改,包括 7 次插入1 次删除
  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()