News for hackers. Stuff that matters.
Re:Why Is It So Hard to Detect Keyup Event on Linux? by topaz0 on Monday May 17, 2021 @12:21PM (#27185208)
In my experience most of these use cases are handled on linux by the window manager calling a script that sends a message to the relevant application, e.g. over dbus.
Re:Why Is It So Hard to Detect Keyup Event on Linux? by reificator on Monday May 17, 2021 @12:33PM (#27185322)
Sure, and that works fine. Just let my application tell the window manager:

* What key events I care about. (I.E. what the keybind should be named in the settings UI)

* What script or message to pass back to me when that event is activated.

* What the default keycombo should be, if any.

Re:Why Is It So Hard to Detect Keyup Event on Linux? by michaelmrose on Monday May 17, 2021 @02:45PM (#27186710)
Some applications prefer to provide a ui for the user to configure a hotkey. This is naturally discoverable within the scope of the other settings in its preferences screen.

Providing a cli interface for automation or binding a hotkey is imo more powerful and useful but its not discoverable. Doubly so for a controlling it over dbus.

The logical thing is that since there is a substantial use case and a desire to limit applications access to global info is that a permission system ought to have been built into Wayland such that applications could request not only global access to the keyboard but permission to get a notification when a particular key press happened.

Since this feature was a staple of desktop operating systems for decades it ought to have been part of the plan from the start.

Re:Why Is It So Hard to Detect Keyup Event on Linux? by zxzax on Monday May 17, 2021 @04:23PM (#27187984)
People have been asking for similar grab-type things since early on in Wayland, and there have been many proposals, but nobody has actually stepped forward to build such a permission system that would work everywhere and would not create additional security problems or would not severely overcomplicate things. It's not a simple thing to do, by any means. If you think you know how, I would urge you to get started designing it and contributing it to some of the major Wayland implementations.
Re:Why Is It So Hard to Detect Keyup Event on Linux? by michaelmrose on Monday May 17, 2021 @05:30PM (#27188699)
I don't really want to be in the business of growing wheat or baking bread if what I actually want is a sandwich but I will happily explain why ___ sandwich shack is doing it wrong because Monday morning quarterbacking is more fun.
Re:Why Is It So Hard to Detect Keyup Event on Linux? by zxzax on Monday May 17, 2021 @05:33PM (#27188725)
I get that, but everyone else also seems to have that attitude, so you see why it doesn't really get done when nobody has any wheat or bread :)