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:
2026-07-03 17:48:33 -04:00
parent 9901f6a34d
commit 1ccd26bbab
7 changed files with 38 additions and 25 deletions
+11 -2
View File
@@ -123,21 +123,30 @@ func _after_tick_loop():
func _process(_delta: float):
if not _is_local:
if input.is_multiplayer_authority():
print("[PLAYER DEBUG] First _process — calling _setup_local_camera (authority: %d)" % multiplayer.get_unique_id())
_setup_local_camera()
else:
print("[PLAYER DEBUG] _process skipping — input not authority (unique_id=%d, input_auth=%d)" % [multiplayer.get_unique_id(), input.get_multiplayer_authority()])
return
# Smooth position interpolation between ticks
var f := NetworkTime.tick_factor
global_position = _lerp_from_pos.lerp(_lerp_to_pos, f)
# Frame-rate mouse look (recoil only affects raycast, not camera)
var old_yaw = _sim_yaw
rotation.y = _sim_yaw + (-input.mouse_rotation.y)
if _sim_yaw != old_yaw or input.mouse_rotation.length_squared() > 0:
pass # mouse look active
head.rotation.x = clamp(_sim_pitch + (-input.mouse_rotation.x), -1.57, 1.57)
head.rotation.y = 0
head.rotation.z = 0
func _rollback_tick(delta: float, tick: int, is_fresh: bool) -> void:
# DEBUG movement state
if input and input.movement.length_squared() > 0:
print("[PLAYER RT] tick=%d movement=%s hp=%d death_tick=%d frozen=%s" % [tick, input.movement, health, death_tick, round_manager and round_manager.freeze_end_tick >= 0 and tick < round_manager.freeze_end_tick])
# Handle round respawn teleport inside rollback
if respawn_tick >= 0 and tick == respawn_tick:
global_position = respawn_position