coleshan / autokey

Automatically exported from code.google.com/p/autokey
0 stars 0 forks source link

Can't pass <alt>+<capslock> to X server #132

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. To reproduce the problem -- You has to have some event binded to 
<alt>+<capslock>. I had keyboard layout switch.
2. Make a AutoKey script: keyboard.fake_keypress("<alt>+<capslock>"). Bind it 
to some key.
3. Save it all and try calling this script - it won't switch the layout, while 
pressing <alt>+<capslock> manually - will.

Original issue reported on code.google.com by kheyfbo...@gmail.com on 12 Aug 2011 at 4:29

GoogleCodeExporter commented 8 years ago
Also here's an error message:

  File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 406, in execute
    exec script.code in self.scope
  File "<string>", line 2, in <module>
  File "/usr/lib/python2.7/dist-packages/autokey/scripting.py", line 96, in fake_keypress
    self.mediator.fake_keypress(key.decode("utf-8"))
  File "/usr/lib/python2.7/dist-packages/autokey/iomediator.py", line 283, in fake_keypress
    self.interface.fake_keypress(keyName)
  File "/usr/lib/python2.7/dist-packages/autokey/interface.py", line 491, in fake_keypress
    keyCode = self.__lookupKeyCode(keyName)
  File "/usr/lib/python2.7/dist-packages/autokey/interface.py", line 660, in __lookupKeyCode
    return self.localDisplay.keysym_to_keycode(ord(char))
TypeError: ord() expected a character, but string of length 16 found

Original comment by kheyfbo...@gmail.com on 12 Aug 2011 at 4:30

GoogleCodeExporter commented 8 years ago
Thanks for this report - looks like a legitimate bug. Will try to fix for the 
next release.

Original comment by cdekter on 11 Sep 2011 at 7:12

GoogleCodeExporter commented 8 years ago
User error - fake_keypress is designed for single keystrokes. If you want to do 
a chord, it should be done like this:

keyboard.press_key("<alt>")
keyboard.press_key("<capslock>")
keyboard.release_key("<capslock>")
keyboard.release_key("<alt>")

Original comment by cdekter on 12 Sep 2011 at 3:53

GoogleCodeExporter commented 8 years ago
keyboard.press_key("")
keyboard.press_key("

Original comment by olszewsk...@gmail.com on 2 Jan 2014 at 11:52