Bypass events and get the physical keyboard state directly

Pekka Paalanen ppaalanen at
Mon Feb 20 08:20:18 UTC 2017

On Mon, 20 Feb 2017 12:37:36 +1300
Bryan Baldwin <bryan at> wrote:

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

But if you run under any kind of display server (windowing system),
that won't usually work at all, or works wrong.

That is also why any kind of "bypass the display server" will not
generally work. There is a myriad of reasons for that, including
permission and security issues, even starting from how to even pick the
right devices.

You really are expected to keep the keyboard state tracked in your app,
based on the events. Even evdev works like that. If you were writing
for Wayland, there would be libxkbcommon to do that, and I believe SDL2
already uses libxkbcommon anyway (on Wayland).

OTOH, if you were not running under any display server, then you'd be
fine with that approach.

Your question would be better directed at SDL or the specific window
system fora (e.g. mailing lists).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the xdg mailing list