Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » [AL 5.1 SVN] PRINTSCREEN key does not generate key down message

Credits go to Audric, Matthew Leverton, and torhu for helping out!
This thread is locked; no one can reply to it. rss feed Print
 1   2 
[AL 5.1 SVN] PRINTSCREEN key does not generate key down message
torhu
Member #2,727
September 2002
avatar

I have some time on my hands now, so I can try to fix it on the Windows side. I think there are a couple of obvious things to do:

  1. The numpad keys should give the same keycode no matter if Num Lock is on or off. This is how it works in A4, and I assume people would generally want it this way for games. The keys would of course still send different character events depending on the state of Num Lock.


  2. The event.keyboard.modifiers field should reflect the actual state of Num, Caps, and Scroll Lock. Which means that the state has to be set at initialization time, and at switch ins.


  3. When the display has lost focus and then regains it, the keyboard state can easily get out of sync with reality. A4 clears all keys on switch out, and then just updates the 3 Lock keys on switch in. I can make A5 do the same, and additionally send key up events for all keys that are down when the switch out occurs. Or maybe I'll do a complete state update, if it's not too much trouble.

I don't know if those 'fake' key up events are always desirable, though. Any thoughts on that?

Is there anything else that's missing? And is this in line with the other platforms?

Evert
Member #794
November 2000
avatar

Elias said:

It just seems neither the Windows nor OSX implementation implements it properly right now.

I think Pete Hull looked into the OS X implementation and concluded that the way it works now is the best that can be done there. I don't remember the details though.

torhu
Member #2,727
September 2002
avatar

I did item 1 and 2. 3 I'll have to think about some more. I'll post patches in the newsgroup.

 1   2 


Go to: