Hacker News new | ask | show | jobs
by jcelerier 391 days ago
How do you implement an app that displays all the keys you type on screen then no matter which Wayland compositor? (For when you're making video tutorials of an app)
1 comments

In short: you wouldn't.

What you are suggesting is overstepping 2 security boundries for unpriviledged apps/processes: 1. Reading global key presses 2. Drawing in an always-on-top window with transparent content

Both these things would require that process to get special user/compositor opt-in permissions and integration. Your best bet would be using compositor plugins/native integration, or maybe you could hook into some toolkits (this is usually what FPS overlays do, hook into the graphics APIs).

That is at least my current knowledge and there might be already some wayland extensions/XDG-portal that allows it, but not to my knowledge.

I mean the reality of things is I'll just add myself to the input and video groups and let the process do what it wants for my computer to be useful