Fix keyboard input not working on Windows client
Added explicit window focus grab after connecting (lan-bootstrapper.gd) so keyboard input is properly received by the input system. Also added diagnostic debug prints to trace input pipeline.
This commit is contained in:
@@ -72,6 +72,9 @@ func join():
|
||||
print("Client started")
|
||||
connect_ui.hide()
|
||||
|
||||
# Ensure game window has keyboard focus for input
|
||||
get_window().grab_focus()
|
||||
|
||||
# Only start manually if NetworkEvents is not handling it (e.g. multiplayer-simple)
|
||||
if not NetworkEvents.enabled:
|
||||
NetworkTime.start()
|
||||
@@ -80,8 +83,14 @@ func _enter_tree():
|
||||
# Hide and show UI as appropriate
|
||||
# These handlers are necessary, since the game could have started via
|
||||
# autoconnect, or any other method
|
||||
NetworkEvents.on_client_start.connect(func(__): connect_ui.hide())
|
||||
NetworkEvents.on_server_start.connect(func(): connect_ui.hide())
|
||||
NetworkEvents.on_client_start.connect(func(__):
|
||||
connect_ui.hide()
|
||||
get_window().grab_focus()
|
||||
)
|
||||
NetworkEvents.on_server_start.connect(func():
|
||||
connect_ui.hide()
|
||||
get_window().grab_focus()
|
||||
)
|
||||
NetworkEvents.on_client_stop.connect(func(): connect_ui.show())
|
||||
NetworkEvents.on_server_stop.connect(func(): connect_ui.show())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user