[bug,linux] keyboard focus lost after changing windows

Started by keturn, June 24, 2014, 11:59:40 PM

Previous topic - Next topic

keturn

I just picked CW3 up on Steam and have been playing in Linux. Things have been working well overall, just one real bug to report:

When I switch away from the game with alt-tab and switch back again, keyboard input is no longer recognized. Mouse clicks still work.

Turning off steam overlay does not make it better.

Happens in both windowed mode and full screen. However, in windowed mode, if I switch by clicking on another window instead of pressing alt-tab, it doesn't seem to break.

Oh, I just figured out an important thing: If, after returning to the window, I press and release the "alt" key, keyboard input starts working again.

I don't know anything about your engine in particular, but to me that strongly suggests this is going on:
- I push alt-tab when in game, game gets a KeyDown event for Alt
- game loses focus
- focus comes back to game later. Game never saw a KeyUp event for Alt, so when I push "p" maybe it's interpreting it as "alt-p".
- pressing and releasing Alt resets it.

I hope information is helpful. Thanks for distributing a Linux version!

CW3 version: 2.08 Steam
Linux distro: Ubuntu 14.04, 64-bit
Window manager: xfwm4 (non-compositing)

Graphics drivers: nvidia

knucracker

Yeah, sounds like the alt "key up" isn't registering after the game loses focus....
And you found the workaround, which is to just tap alt again after returning to the game.