allegro5 icon indicating copy to clipboard operation
allegro5 copied to clipboard

Pressing SHIFT when holding ALT on windows emits a nil key event

Open connorjclark opened this issue 2 years ago • 2 comments

I found this bug because there's a command in my application that does something when SHIFT and ALT are held down. It works when first pressing SHIFT then holding ALT too, but not the other way around.

From debugging, I found that the second key event received when doing ALT then SHIFT is zero'd out and only has the ALT bit enabled in modifiers:

{type=11 source=0x00007ffe3bcf6d40 {allegro-5.2.dll!ALLEGRO_KEYBOARD the_keyboard} {...} timestamp=341.56358236244910 ...}
    type: 11
    source: 0x00007ffe3bcf6d40 {allegro-5.2.dll!ALLEGRO_KEYBOARD the_keyboard} {...}
    timestamp: 341.56358236244910
    display: 0x000001eed147f840 {...}
    keycode: 0
    unichar: 0
    modifiers: 4
    repeat: false

My expectation is that either modifiers would have the SHIFT bit enabled, or that (also?) keycode is set to the value for the shift key.

Perhaps related: #713

connorjclark avatar Jul 14 '22 05:07 connorjclark

Any pointers on where to start with this?

connorjclark avatar Sep 01 '22 05:09 connorjclark

Do you still get a KEY_DOWN event for SHIFT or is it a nil CHAR event? What does ex_keyboard_events do in this case?

On 9/1/2022 12:09 AM, Connor Clark wrote:

Any pointers on where to start with this?

— Reply to this email directly, view it on GitHub https://github.com/liballeg/allegro5/issues/1348#issuecomment-1233747637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2JBYJJO373YEKORBRQPV3V4A3BDANCNFSM53Q7UP6Q. You are receiving this because you are subscribed to this thread.Message ID: @.***>

EdgarReynaldo avatar Sep 01 '22 13:09 EdgarReynaldo

#1404 should fix the weird key event, but the fixed key down events don't have modifiers. Ctrl/Shift/Alt are pretty wonky keys, I'm not sure I can get modifiers for them.

SiegeLord avatar Feb 01 '23 09:02 SiegeLord