Can send <shift>+<left> but not <shift>+<right>

81 views
Skip to first unread message

harpend

unread,
May 12, 2012, 4:11:03 PM5/12/12
to autokey-users
Using Mint 12 and the current PPA version of autokey, I have two
nearly identical scripts that read a global variable "markon" and
either send an arrow key or a shift arrow key. Here is one:

if not store.has_key("markon"):
store.set_global_value("markon",0)
x=store.get_global_value("markon")
if x==0:
keyboard.send_keys("<right>")
else:
keyboard.send_keys("<shift>+<right>")

and the other is identical with <right> replaced by <left>

The version that sends left arrow or shift-left works just fine. The
other script that send right or shift right will not send shift
right. I have the same experience with others, for example a script
sends <home> just fine but will not send <shift>+<home>.

Here is the debug output for the <left> version that works fine:


2012-05-12 13:42:35,385 INFO - service - Matched hotkey phrase/script
with prompt=False
2012-05-12 13:42:35,385 DEBUG - service - Script runner executing:
Script('ctlh')
2012-05-12 13:42:35,386 DEBUG - iomediator - Send via event interface
2012-05-12 13:42:35,386 DEBUG - service - Ignored locking error in
handle_keypress
2012-05-12 13:42:35,388 DEBUG - interface - Send modified key:
modifiers: [u'<shift>'] key: <left>
<---------------------------------------------------------------
2012-05-12 13:42:38,681 DEBUG - service - Raw key: u'l', modifiers:
['<ctrl>'], Key: l
2012-05-12 13:42:38,682 DEBUG - service - Window visible title:
u'*Untitled Document 1 - gedit', Window class: 'gedit.Gedit'


and here is the output from the (failed) right version:

2012-05-12 13:40:01,525 INFO - service - Matched hotkey phrase/script
with prompt=False
2012-05-12 13:40:01,525 DEBUG - service - Script runner executing:
Script('ctll')
2012-05-12 13:40:01,526 DEBUG - iomediator - Send via event interface
2012-05-12 13:40:01,526 DEBUG - service - Ignored locking error in
handle_keypress
2012-05-12 13:40:01,531 DEBUG - interface - Send special key:
[u'<right>']
2012-05-12 13:40:02,010 DEBUG - service - Raw key: u'l', modifiers:
['<ctrl>'], Key: l
2012-05-12 13:40:02,010 DEBUG - service - Window visible title:
u'*Untitled Document 1 - gedit', Window class: 'gedit.Gedit'

The line in the first block with the arrow pointing to it is not in
the second block. The two scripts are identical: I copied the good
one, pasted it into the editor and changed "left" to "right" in it.

Would be grateful for any help.

Thanks, Henry Harpending


Chris D

unread,
May 14, 2012, 10:18:49 PM5/14/12
to autoke...@googlegroups.com
I'll need to look into this further - could you please compile this information into a bug report?

Henry Harpending

unread,
May 14, 2012, 11:02:33 PM5/14/12
to autoke...@googlegroups.com
Thanks, I will be happy to. Can you point me to instructions?

Thanks, Henry Harpending

teika kazura

unread,
May 21, 2012, 8:24:51 AM5/21/12
to autokey-users
Hi, Henry. I suggest you to check with "xev".

1. Install xev.
2. Stop autokey, and run xev from the shell. Move the focus to the xev
window.
3. Press and release Shift+left / right.

The output should look almost the same for both left and right. If
not, your keyboard configuration may need a fix.

Sometimes the keyboard device limitation does matter, but this is
rare. I remap modifier keys to unusual positions, and ctrl+alt+del nor
ctrl+alt+down is not detected on one keyboard. On another, ctrl+alt+up
is ignored! Yours are combinations of two keys, and it's likely that
they're handled.

Regards.

Henry Harpending

unread,
May 21, 2012, 9:02:53 AM5/21/12
to autoke...@googlegroups.com
Thanks for this suggestion. I did not file a bug report because I know I would not do it right, and I had an old version of autokey that came with ubuntu linux. I updated to the current ppa version and still had the problem but with both Shift+left and Shift+right.

Some experimentation left me thinking that the test

if not store.has_key("markon"):

was not detecting global keys. I am not enough of a programmer to dig further, so I changed my scripts to incorporate a try-except phrase at the beginning, like this:

try:
x=store.get_global_value("markon")
except:
store.set_global_value("markon",0)
if x==0:
keyboard.send_keys("<page_up>")
else:
keyboard.send_keys("<shift>+<page_up>")

and now everything works just fine.

Best, Henry Harpending
Reply all
Reply to author
Forward
0 new messages