macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

`is_key_down` function is not working properly on Linux.

Open baehyunsol opened this issue 3 years ago • 12 comments

is_key_down function is not working properly on Linux.

I'm using Ubuntu with LeftWM. The window manager uses Mod + Shift + (1 - 9) to move a window to another desktop. When I use the keys to move my game to another desktop, is_key_down(KeyCode::LeftShift) || is_key_down(KeyCode::RightShift) keeps returning true even after I released the shift key. It goes back to normal after I press Shift key again.

I tested the same thing on other keys, but it only makes problem with Shift keys. When using Mod + Shift + 4 to move my game to 4th desktop, is_key_down(KeyCode::Key4) does not make any problem.

baehyunsol avatar Jan 01 '22 04:01 baehyunsol

Same thing happens on MacOS when CMD key is down at the same time as (in my case) the arrow keys.

Edersteiner avatar Jan 02 '22 22:01 Edersteiner

Do you have sticky keys on?

eboatwright avatar Jan 05 '22 20:01 eboatwright

@eboatwright It's not on.

baehyunsol avatar Jan 10 '22 06:01 baehyunsol

hm

eboatwright avatar Jan 10 '22 16:01 eboatwright

I have a similar issue but with an other rust game lib (Coffee). Maybe third party related ?

buxx avatar Feb 03 '22 12:02 buxx

@buxx are you using Windows?

I'm using Ubuntu 21.10 with LeftWM

baehyunsol avatar Feb 03 '22 12:02 baehyunsol

@baehyunsol Using Ubuntu 20.04 and Kubuntu 21.10 (same on both).

This behavior happen to me when I switch workspaces with CTRL+ALT+arrow

buxx avatar Feb 03 '22 13:02 buxx

I think it's just keyboard related / switching workspaces or pressing weird keys messes with keyboard inputs

eboatwright avatar Feb 03 '22 16:02 eboatwright

Hello I'm a student in IT. I would like to make my first contribution to an open projet.

I was able to reproduce the bug on MacOS Monterey 12.1. The main issue (on macOS) in my opinion is that using SuperKey and any others keys shortly after, doesn't trigger the key_up_event for the others.

On the Library SOKOL used by this projet we can see some workaround with the SuperKey maybe it's the source of the problem

sokol_app.h

Bibi210 avatar Feb 07 '22 13:02 Bibi210

I just saw that the miniquad project used to manage inputs doesn't have the last version with the workaround. A simple update might solve the issue. Old sokol_app.h currently used New sokol_app.h with the fix

Bibi210 avatar Feb 07 '22 13:02 Bibi210

I think this is an issue for Miniquad and not for Macroquad (I created one https://github.com/not-fl3/miniquad/issues/353). I looked quickly and, when pressing Shift on MacOS, the callback registered by miniquad is not called when Shift is pressed (it is for other key). @not-fl3 Any plan to update to the latest version of miniquad? That would help to investigate and eventually merge an eventual fix.

IohannRabeson avatar Mar 19 '23 04:03 IohannRabeson