XMonad.Util.Paste.sendKey does not work in some applications?

49 Views Asked by At

While experimenting with XMonad.Util.Paste from xmonad-contrib, I realized that the following key-binding works for some applications (e.g. Firefox and Chromium) but does not work for others (e.g. Emacs, XTerm, Xiate (a GTK-based terminal-emulator)):

("C-a", sendKey controlMask xK_n)

With this key-binding active in XMonad, I can create new windows in Firefox and Chromium (which is bound to C-n) by pressing C-a. In Emacs, XTerm and Xiate, pressing C-a does not translate to C-n; in Emacs and Xiate I can only see the cursor "blink" once when I press C-a.

Why does this key-binding not translate in any focused application as expected?

1

There are 1 best solutions below

0
On

As geekosaur in #xmonad:libera.chat pointed out, the respectively targeted application needs to support X11's send_events feature.

You can launch XTerm to support that as follows:

xterm -xrm '*allowSendEvents:true'

Emacs seems to support that feature when compiled with Motif toolkit (--with-x-toolkit=motif), or with no X toolkit (--with-x-toolkit=no).