On Tue, Jan 12, 2016 at 11:34 AM, Tycho Andersen <[email protected]> wrote:
> untested, but something like this should work:
>
> def foo(qtile):
> paste["vim"] = (["control"], "v")
> ...
>
> try:
> args = paste[qtile.currentWindow.name]
> qtile.cmd_simulate_keypress(*args)
> except KeyError:
> pass # do something default
Interesting, unfortunately I never could make
qtile.cmd_simulate_keypress() work as expected.
It fails in manager#handle_KeyPress() stating it ignores the keypress:
2016-01-12 19:54:58,258 INFO _xpoll:734 Handling: PropertyNotify
2016-01-12 19:54:58,652 INFO _xpoll:734 Handling: KeyPress
2016-01-12 19:54:58,653 INFO call:92 Command: function((<function test
at 0x7f808a45b320>,), {})
2016-01-12 19:54:58,674 INFO handle_KeyPress:904 Ignoring unknown keysym: 105
2016-01-12 19:54:58,707 INFO _xpoll:734 Handling: PropertyNotify
2016-01-12 19:54:58,710 INFO fire:270 Internal event: window_name_change((), {})
2016-01-12 19:54:58,710 INFO _xpoll:734 Handling: PropertyNotify
2016-01-12 19:54:58,710 INFO fire:270 Internal event: window_name_change((), {})
My test function should just simulate the keypress of key 'i' (without
modifiers) and xev confirms the keysym is 0x69 (105):
I press the trigger (Win+o for my test) in terminator and expect to
see the letter 'i' printed.
def test(qtile):
qtile.cmd_simulate_keypress([], "i")
Note: this was tested on 0.10.3 (fresh stable from pip)
--
Fabien Meghazi
http://www.amigrave.com
--
You received this message because you are subscribed to the Google Groups
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.