Bypass events and get the physical keyboard state directly

Bryan Baldwin <[email protected]>
Newsgroups gmane.linux.xdg.devel
Message-ID <[email protected]>
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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/xdg
signature.asc (application/pgp-signature, 862 B)
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEE1OFiBHnOnhbgzKuUFdP+xtZORC8FAliqGe4VHGJyeWFuQGth
dG9maWFkLmNvLm56AAoJEBXT/sbWTkQvsm4P/Rk4Ay6B79TJmIqoBemYd6r5ll6z
+0ys7l3lANwrrJUj6f2lDn3QWWCnC6+rjRZqrsdtkaMz/pQuNmRlQ5jgV/r8yTZX
zSBBiFKa+MTEXIZhspiH4dVEa91dmYdTMP3UDFXb2fivOsR2hfTBRLiiX5MCzhge
PcaAHslqbW3UfPnliCM4cpMrNazrl7V/tVdFPTHtSA7Bsye/bnLne2IpM7xxu8ea
mtDCQ6wpA9J0YYFULlzxtKZ8x1rURM5vuW4h8Dkh2R7JQ9NSkEl5VMOdAJHwYf6N
pPjIHpyi7fu/RG0c/sdGjSxF6tADJlWF937SRtRREYcmzINgtjJomMWPWnhrz3CK
FvbvV0BG/ggQTTwJiK0L5giW59OfofSJiuZpWGxiXq/G9GjouMQ05O89klZNkO6A
A3WqxFqwvajUsv8bt5dCyA1I9OvUfBMsCpGxVB95qAsKQyPkTi7T5CMNc4Yk8m0v
X+fMxe3qK/d0+PF0Z1tA3SCob1Jcg5CCnj7+uqxMZzyvm0jUMK1+C/XEPltkjAIB
g/vsn1C9hdijVuo8CBrtOTQpnVjWXe/RYWdWVJuHRBiy1BNp+hwg06nb5rUmWzt+
y0DTtFUa4DWkh1f7fFvE16JHvRr1ezDLZZSxxIYeMf/W1RnQhKjZIWeGxzzNYHbJ
cnPF6/1AC8NVgAL+
=YpXQ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.