> Run autokey-gtk -l from a console
> press a couple of your numeric keys
> stop autokey
> look at the end of the log output for where autokey detected your
> keypresses and see what it called them.
I do not have autokey-gtk installed so I ran autokey-qt -l instead. When I press numpad0 it prints:
"Raw key: '<np_insert>', modifiers: [], Key: <np_insert>"
When I tried keyboard.send_key("<np_insert>") it sent numpad "insert" key instead of numpad0.
> You can either just try things or read the autokey source code to see what it wants.
I ran "apt-get source autokey-qt" and looked into the source code. Only numeric numpad key I found is <np_5> but it turned out to be non-numeric - it does almost nothing like I have numlock turned off. It seems like numpad support is partial - only numpad keys with numlock turned off are supported (it does not matter if numlock is turned on or turned off on my keyboard - autokey ignores it).
Currently I use this line to send numpad0:
system.exec_command("xdotool key KP_0")
Hopefully full support for numpad keys will be added in future version of autokey.
On Sunday 05 January 2014 22:18:01 Joe wrote:
> I wonder what it would do if you bracketed <np_insert> with <numlock>
> before and after.
Nothing useful unfortunately. I still get numpad_insert instead of numpad_0.
> I also wonder if <np_0> would work or come back as an error.
In the source only np_5 is mentioned, so np_0, np_1, etc. will not work. In the source:
http://code.google.com/p/autokey/source/browse/trunk/src/lib/interface.py?r=430
I can see XK_TO_AK_NUMLOCKED but missing np_0-4 and np_6-9 are strange... I guess something was left unfinished and it does not work.
> Cool that it works for you. (I assume that code is in your keyboard macro.)
Yes, that's line from my autokey script. So this is minor problem because workaround is so easy. I just thought autokey can do this too so I decided to ask. But apparently not yet.