Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, but any application with that privilege can log all keystrokes and upload it to a third party. Obviously this privilege needs to be far more fine grained and have limitations, i.e. registering a hook on particular key combinations, rather than listening on all key events.



The accessibility permission isn't just for listening to key events. It's for looking at and manipulating content on screen, e.g. moving windows around, sending synthetic keyboard/mouse events, etc. Registering hooks on a specific key combination is a separate API which doesn't require elevated permissions.


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)


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: