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:
@@ -161,6 +161,10 @@ func _rollback_tick(delta: float, tick: int, _is_fresh: bool):
|
||||
if rollback_synchronizer.is_predicting():
|
||||
return
|
||||
|
||||
# DEBUG: weapon switching
|
||||
if input and (input.slot_1 or input.slot_2 or input.slot_3 or input.slot_4):
|
||||
print("[WEAPON DEBUG] _rollback_tick tick=%d slots=[s1=%s s2=%s s3=%s s4=%s] active=%d inv=%s" % [tick, input.slot_1, input.slot_2, input.slot_3, input.slot_4, active_slot, inventory])
|
||||
|
||||
# Skip if player dead
|
||||
if player.death_tick >= 0 and tick >= player.death_tick:
|
||||
return
|
||||
@@ -406,3 +410,8 @@ func _spawn_grenade(origin: Vector3, direction: Vector3, owner_id: int, type_idx
|
||||
get_tree().current_scene.add_child(grenade)
|
||||
var gtype: Grenade.GrenadeType = Grenade.GrenadeType.FLASH if type_idx == 0 else Grenade.GrenadeType.SMOKE
|
||||
grenade.setup(origin, direction, owner_id, gtype)
|
||||
|
||||
func _rollback_tick(delta: float, tick: int, _is_fresh: bool):
|
||||
# DEBUG: Log when this is called with non-default input
|
||||
if input and (input.slot_1 or input.slot_2 or input.slot_3 or input.slot_4):
|
||||
print("[WEAPON DEBUG] _rollback_tick tick=%d slots=[%s %s %s %s]" % [tick, input.slot_1, input.slot_2, input.slot_3, input.slot_4])
|
||||
|
||||
Reference in New Issue
Block a user