Bypass events and get the physical keyboard state directly

Bryan Baldwin bryan at katofiad.co.nz
Sun Feb 19 23:37:36 UTC 2017


Okay, so further investigation has lead me to test code against evdev
directly. Nevermind ;)


On 02/20/2017 11:19 AM, Bryan Baldwin wrote:
> Hello all,
>
> I've been writing game code, and have gone adrift with a big problem
> with keyboard input.
>
> The properties I'm getting through SDL2 contain key up/down,
> pressed/released, and repeat. I've read either that the pressed/released
> properties are only set with the key actually physically down, or that a
> keyboard event will at least have the repeat property set if the key is
> a repeat. I can't confirm that any of this is true in code.
>
> No matter what I do, if I hold down a key I get the first key down +
> pressed event, a subsequent event flagged as a repeat at the delay
> threshold (500ms), and then a deluge of *unflagged* key down+pressed /
> key up+released event pairs for the rate interval that continue
> repeating well after the key is actually released. I tried using SDL2's
> GetKeyboardState instead, but this produces identical results. Its the
> same data as events with a different interface.
>
> The documentation I've read for keyboard input with X11 also follows a
> very similar event-based model, but what I want is a way to check the
> keyboard and literally only see exactly what the state of the keys at
> the instant that that call is made, and by-pass any and all other
> processing entirely, including auto-repeat.
>
> Can anyone point me in the right direction?
>
>
>
> _______________________________________________
> xdg mailing list
> xdg at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/xdg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/xdg/attachments/20170220/8b8be6f5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 862 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/xdg/attachments/20170220/8b8be6f5/attachment.sig>


More information about the xdg mailing list