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

The answer is "it depends on how much work you want to put into making custom protocols for these purposes".

>Is it possible to implement an interaction bound to a global hotkey (e.g. middle click) that takes the current selected text (in any window) and send it to the event target window as keypress events? Without special support from either program? [xselection pasting]

Yes, doing it the way you described is possible. Or you could just use the existing and moderately-well-supported primary selection protocol:

https://github.com/swaywm/wlroots/blob/master/protocol/gtk-p...

We should try to get that standardized...

>Can I monitor and/or intercept (block) input events of any program without special (voluntary) support from the monitored program? Can I send arbitrary synthetic input events? [hotkey macros]

Sure, from the compositor. If you want clients to call the shots you need a protocol.




> it depends on how much work you want to put into making custom protocols for these purposes

> Or you could just use the existing and moderately-well-supported primary selection protocol

Unless I'm missing something that requires support from both programs (or at the very least the program that you copy from).


Yes, but so does Wayland support in general. Protocols are the bread and butter of Wayland, the core Wayland protocol is very conservative (it doesn't even specify application windows).




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

Search: