Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shift key not recognized when focus is changed to QB64 program
#12
Something to note, on Windows the Shift keys are special/bugged, I think that's part of what you're seeing and probably why _KeyDown doesn't report it in this case. I put in a bug fix for the shift keys a while back that applies to _Devices, that's why it's always correct, in that case it uses GetAsyncKeyState to check the shift keys rather than relying on the WM_KEYDOWN and WM_KEYUP messages.

In regards to keyboard state when not in focus, in theory I don't think we should see any keys when the window loses focus but they should appear as pressed when the window regains focus if they were held down. GetAsyncKeyState does allow you to see the keys at all times on Windows, I believe. On Linux and potentially Mac OS that's not always allowed for security reasons though, so it's not really something you can reliably implement in a platform-independent way.
Reply


Messages In This Thread
RE: Shift key not recognized when focus is changed to QB64 program - by DSMan195276 - 09-17-2024, 08:55 PM



Users browsing this thread: 6 Guest(s)