1c7342464a33e207d9e5323bbab9bd32789d7d79 — Drew DeVault 8 months ago a450d43
godotston: send keyboard events to clients
2 files changed, 15 insertions(+), 0 deletions(-)

M godotston/Main.gd
M godotston/Surface.gd
M godotston/Main.gd => godotston/Main.gd +13 -0
@@ 29,5 29,18 @@
 	get_node("ViewportBounds/Bottom").shape.d = -vp.y
 	get_node("ViewportBounds/Right").shape.d = -vp.x
 
+func _on_wlr_key(keyboard, event):
+	var seat = get_node("WaylandDisplay/WlrSeat")
+	seat.keyboard_notify_key(event)
+
+func _on_wlr_modifiers(keyboard):
+	var seat = get_node("WaylandDisplay/WlrSeat")
+	seat.keyboard_notify_modifiers()
+
 func _ready():
 	get_viewport().connect("size_changed", self, "_on_viewport_change")
+	var seat = get_node("WaylandDisplay/WlrSeat")
+	var keyboard = get_node("WaylandDisplay/WlrKeyboard")
+	seat.set_keyboard(keyboard)
+	keyboard.connect("key", self, "_on_wlr_key")
+	keyboard.connect("modifiers", self, "_on_wlr_modifiers")<
\ No newline at end of file

M godotston/Surface.gd => godotston/Surface.gd +2 -0
@@ 26,6 26,8 @@
 func focus():
 	if toplevel != null:
 		toplevel.set_activated(true)
+	if seat != null:
+		seat.keyboard_notify_enter(xdg_surface.get_wlr_surface())
 
 func _handle_destroy(xdg_surface):
 	queue_free()