[reviving an old thread that I lost track of]
> On Sun, 14 May 2023, Thomas Adam wrote:
> > On Sun, 14 May 2023 at 22:12, Lucio Chiappetti wrote:
> >> So the problem is an incompatibility between xterm and fvwm syntethic
> >> events (or a syntax problem with PointerKey ?)
>
> > No.  By default generating synthetic events is considered a security 
> > risk. which is why so many applications now no longer support them.
>
> For my education ... what are *exactly* synthetic events ?

 My understanding is that synthetic events are events generated with the
XSendEvent() function (and its corresponding part of the X protocol).
This is a very old function that can be used by any X client, so the X
server specifically marks its events and as Thomas Adam noted, many
clients decided to distrust them so that some random (malicious) client
couldn't inject keystrokes into your xterm session. Some programs,
including xterm, can be set to accept such events, and these days there
may not be too many security risks in doing so.

 Portions of what xdotool can do work despite this because they don't
necessarily use XSendEvent; instead they (sometimes) use a newer
protocol extension called XTEST, which was apparently originally created
to test the X11 server with no user interaction. Events injected through
XTEST are not specially flagged and so clients like xterm don't get to
reject them. The xdotool manual page contains a bit of a discussion of
this.

> So what could be an "action" to be put at the end of a Key or PointerKey 
> directive to do a X11 native "paste from clipboard"  (other that xdotool 
> click 2 which introduces a level of indirection) ?

 In general, as far as I know there is no way for an outside program to
tell xterm 'paste from clipboard'. All an outside program can do is tell
xterm things like 'mouse button 2 was clicked' or 'key X was pressed'.
What xterm does in reaction to this depends on it, including what state
xterm is in at the time (for example, if it's showing one of its menus).
There are weird options here if you want to get deep into the weeds of
xterm configuration. Xterm can be told to bind keys to internal actions,
such as 'paste', so you can create a 'key' binding for a key and
modifier combination you'll never type normally and use xdotool to
inject it into xterm (with xterm set to allow that).

More details on the general issue is in the xterm manpage; if you're
interested in an example of xterm translations:
https://utcc.utoronto.ca/~cks/space/blog/unix/XtermKeybinding

        - cks

Reply via email to