0

I have a specific problem with keyboard shortcuts and haven't gotten a solution for it so far, so now i need to know which module within a Linux distribution is responsible for handling keyboard shortcuts.

By handling keyboard shortcuts, I mean, listening to the key pressing\releasing events.

Muhammad Gelbana
  • 1,643
  • 8
  • 20
  • 26

1 Answers1

2

That depends: on the Linux console, the responsible "module" is the kernel. In X, the X server interprets the underlying keyboard events and passes some of those on to clients as key press and release events.

That is as far as it goes. In a terminal emulator, applications do not read events (unless they open a special connection to the console). They read characters.

Thomas Dickey
  • 76,765
  • Do you know if there is a way to configure way the X server to handle keyboard shortcuts in an on-release manner rather than on-press ? X server on most distributions handle keyboard shortcuts in an on-press manner. – Muhammad Gelbana Sep 04 '16 at 10:32
  • That sort of thing is done at the application level (applications interpret events). xmodmap is an application, as would be your window manager. – Thomas Dickey Sep 04 '16 at 10:53
  • By "applications", do you also mean an arbitrary desktop application like a browser ? If that's so, then why when I use the same application on different distros, keyboard shortcuts are handled when they are pressed, while on other distros, keyboard shortcuts are handled when they are released ? – Muhammad Gelbana Sep 04 '16 at 11:02
  • yes: any X client can interpret key events in a different way. Some applications (such as a window manager) get those first and can prevent others from using a given combination. – Thomas Dickey Sep 04 '16 at 11:09
  • I tested the output of wmctrl -m that shows the window manager on LMDE (Linux mint, Debian edition) and Linux mint Ubuntu edition and they both had the same output. Yet both handle keyboard shortcuts differently. Debian first a keyboard shortcut on-press, while Ubuntu handles it on-release.

    Probably the window manager isn't the responsible module ?

    – Muhammad Gelbana Sep 04 '16 at 21:19
  • wmctrl -m only shows a small part of the window manager (see EWMH, which is what wmctrl deals with). – Thomas Dickey Sep 05 '16 at 00:11