Open morgant opened 5 years ago
Interestingly, "Open Location..." Action SendMessage C+L
works for Chromium/chrome
under OpenBSD 6.4, so I'm not sure if it was just the other browser I was testing that wasn't working.
I'm not sure if I was accidentally preceding the line with "Menu" or what, but SendMessage
has been working through OpenBSD 6.5 & 6.6. That said, it can sometimes be inconsistent in the window/application receiving it.
One thing I've discovered is if you want to send a key press without a modifier key, one must precede it with N+
(no modifier), e.g. "Next" Action SendMessage N+P
.
Re-opening this as @pierre-rs pointed out that SendMessage
is not working for ARandR under a number of OSes. I've confirmed under OpenBSD amd64/7.3-stable.
In experimenting with xvkbd
under OpenBSD amd64/7.5-stable, I read the following passage in the manual:
-xsendevent
Make xvkbd to use XSendEvent() to simulate keyboard events, as it was
in xvkbd version 1.0. xvkbd version 1.1 and later will try to use
XTEST extension instead in the default configuration. Because it is
not unusual applications to ignore keyboard events generated with
-xsendevent, you shouldn't use -xsendevent option unless it is really
required.
If XTEST extension is not supported by the X server, xvkbd will
automatically switch to this mode.
Resource `xvkbd.xtest: false' has the same function.
It immediately made me think of this issue as mlvwm
is still using XSendEvent
, not the XTEST
X11 extension. (Of course, I had completely forgotten that I had already referenced xvkbd
documentation in this issue!) So, I should really start by addressing this by using XTEST (see the xtest1(3) manual), when available.
In the development various MLVWM styles for various applications as part of mlvwmrc, I can't seem to get Menu
SendMessage
actions (e.g.Menu "Open Location..." Action SendMessage C+G
which should send a Control-G keypress to the active window) to function. I'm currently testing on OpenBSD 6.4.I've even configured a style for
xev
(the X Windows event tester) and can confirm that a KeyPress is being sent. My current observations:sendevent()
infunctions.c
only fires a single 'KeyPress'XSendEvent()
for each key, but doesn't send a 'KeyRelease'sendevent()
specifiessame_screen = false
, while actual keypress/keyrelease events havesame_screen = true
(as confirmed withxev
)xev
, the KeyPress event does appear to have the correctstate
value (which specifies the modifier key), but maybe it'd be better to send a 'KeyPress' for the modifier, then the 'KeyPress' & 'KeyRelease' for the key, followed by a 'KeyRelease' for the modifier?XSendEvent()
(those send_event flag in Event struct were set) may ignored by some clients", see http://t-sato.in.coocan.jp/xvkbd/events.html