morgant / mlvwm

Macintosh-like Virtual Window Manager (official repo)
http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html
280 stars 9 forks source link

Menu `SendMessage` actions not working on OpenBSD 6.4 #2

Open morgant opened 5 years ago

morgant commented 5 years ago

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:

morgant commented 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.

morgant commented 4 years ago

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.

morgant commented 1 year ago

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.

morgant commented 1 month ago

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.