Anyone familiar with #x11 could give me a hand with something?
I'm trying to send a key event to a previously focused window that is not itself.
For example, you focus on firefox, then open a terminal window and run this, the event is sent to firefox, and not itself.
https://paste.sr.ht/~rabbits/c6e817d573b0ffcc26cfa76d4fd602513a9386c9
David JONES
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to David JONES • • •David JONES
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to David JONES • • •my goal is to make an on-screen keyboard in Uxn, it's something I'd use daily.
The uxn emulator I have is written in x11 itself, but I would like not to have to modify the emulator, ideally I'd use a small intermediate program, like:
uxn11 keyboard.rom | some_little_program
The keyboard rom will send stdout events, and some_little_program will be the bit that handles the logic of which keycode to send, and which window to send it to
David JONES
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to David JONES • • •David JONES
in reply to Devine Lu Linvega • • •I only ever wrote 1 X11 program, but it was using XLib and none of the new-fangled framework nonsense (it was on a DEC Ultrix machine in about 1994). I _think_ you "simply" call XNextEvent; see how xev.c does it https://gitlab.freedesktop.org/xorg/app/xev/-/blob/master/xev.c#L1479
I _think_ by default an X11 client gets all events (for all windows!) unless it has requested only events for particular windows (like their own, which most apps would do); i think that's XSelectInput.
xev.c · master · xorg / app / xev · GitLab
GitLabDevine Lu Linvega
in reply to David JONES • • •ArBe
in reply to Devine Lu Linvega • • •Anders Conbere
in reply to Devine Lu Linvega • • •I’d probably set up a global key event listener and then keep track of my windows on my own. Like this keylogger. Not sure if this is quite what you want though.
https://github.com/anko/xkbcat/blob/master/xkbcat.c
marmarta
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to marmarta • • •pengaru
in reply to Devine Lu Linvega • • •Shae Erisson
in reply to Devine Lu Linvega • • •dunno if this is helpful, but I wanted a shell script to mute zoom, ended up with this:
xdotool windowactivate --sync $(xdotool search --name 'Zoom Meeting') key alt+a
which is roughly
1. find the identifier for the X window titled "Zoom Meeting"
2. send the key "Alt a" to that window
Devine Lu Linvega
in reply to Shae Erisson • • •penguin42
in reply to Devine Lu Linvega • • •timthelion
in reply to Devine Lu Linvega • • •Order array of windows by z order
Stack OverflowDevine Lu Linvega
in reply to timthelion • • •