On 2005-09-02, joe crayne <[EMAIL PROTECTED]> wrote: > Is there a lua function available to simply simulate a keypress? > > I used to use ratpoison and wanted to keep my old key bindings, so=20 > i configured a control-T escape key sequence analogous to ratpoison. > The problem is, i'd like to be able to send a control-T to an application b= > y > using Control-T T similar to the way screen uses control-A A, but I know=20 > no way to send a character like that.
There ioncore.quote_next bound to Mod1+K Q by default, but it will just send the next key, and _it does not always work_. I know of no nice and simple way to reliably send an arbitrary keystroke to an application from a keybinding that must be grabbed, as grabs change the focused window for the duration of the grab, and there does not seem to be any way to know which subwindow (widget) of a client window was focused before the grab changed the focus unless one monitors every single window (this includes every single pushbutton and so on!) for focus change events. This is a bit too brute force appraoch. The XTest extension, on the other hand, is rather low-level and thus cumbersome. The best approach to allowing applications to receive keys that are normally needed to use Ion seems to be a disable-bindings mode, and there infact was such a patch in the svn repo, but the author hasn't yet converted the changes to darcs so I might get around to actually reviewing them and so on. -- Tuomo
