davidben / uqm

Port of The Ur-Quan Masters to Native Client
https://chrome.google.com/webstore/detail/the-ur-quan-masters/dieafepjepbfogacjnifndljhlpiggmb
Other
23 stars 3 forks source link

Key-up events not sent when focus lost #18

Closed davidben closed 12 years ago

davidben commented 12 years ago

If you use, e.g., Ctrl-tab to switch tabs, the key-up for Ctrl is never sent and the game thinks you never released the key.

davidben commented 12 years ago

This is particularly a nuisance on the Mac where Ctrl-array switches desktops, but those shortcuts are pretty unusable there anyway. Maybe worth switching Cmd and Ctrl or something like that.

Alternatively, figure out why the return key doesn't work.

davidben commented 12 years ago

This feature is actually part of SDL. Except NaCl doesn't hook it to anything. Have some working code, but it needs a little tidying because it can be upstreamed. Need to hook up SDL_ActiveEvent. SDL_APPINPUTFOCUS (focus event listener) in particular, but may as well also do SDL_APPMOUSEFOCUS (PPAPI enter/leave events) and SDL_APPACTIVE (page visibility API or future pp::View::IsPageVisible).