toprekt2 / autokey

Automatically exported from code.google.com/p/autokey
GNU General Public License v3.0
0 stars 0 forks source link

Autokey hangs on rapid key press. #137

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I create a simple global key remap like j = <left>.
2. Hold down j for a second or just press it often.

What is the expected output? What do you see instead?
Autokey process hangs with 100% cpu. All remaps stop working, but initial keys 
are still blocked, so j is not typed.

What version of the product are you using? On what operating system?
0.71.3-1. Ubuntu 11.04.

If key repeat rate is like 5 symbols a second, then there is no hang when I 
hold the key down.

Original issue reported on code.google.com by Huru...@gmail.com on 16 Aug 2011 at 9:46

GoogleCodeExporter commented 8 years ago
How are you creating the remap, exactly?

Original comment by cdekter on 16 Aug 2011 at 10:36

GoogleCodeExporter commented 8 years ago
I add a new phrase, put j as hotkey and write <left> in the body.

Original comment by Huru...@gmail.com on 16 Aug 2011 at 11:00

GoogleCodeExporter commented 8 years ago

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

GoogleCodeExporter commented 8 years ago
Fixed the hang by putting some locks around the keyboard grab/ungrab - 
python-xlib didn't like things happening so fast. At the same time, I don't 
recommend the method you are using as a way to remap keys. The amount of code 
that needs to execute as part of sending a phrase is far to large for this kind 
of application. You are better off creating a script and using 
keyboard.send_key().

Original comment by cdekter on 12 Sep 2011 at 6:26

GoogleCodeExporter commented 8 years ago
I see, I'll try to write a script. Thanks.

Original comment by Huru...@gmail.com on 12 Sep 2011 at 6:47

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have the same issue even when using a script as suggested.

I just posted in " Issue 104 : autokey-gtk and -qt takes 100% of CPU in Ubuntu 
10.10 during night" (https://code.google.com/p/autokey/issues/detail?id=104), 
but my issue seems even more closely related to this one: I can sometimes can 
trigger a hang of the system by pressing a hotkey combination a couple of times 
in a row. Then, I have to change to a shell TTY and kill autokey to be able to 
do anything in the window environment again.

My autokey scripts (each 1 line):
keyboard.send_keys("<ctrl>+<shift>+<down>")
hotkey: <shift>+<down>

keyboard.send_keys("<ctrl>+<shift>+<down>")
hotkey: <shift>+<up>

Any hint on how to improve the situation ('nice' autokey differently? add 
auxiliary commands to autokey script?) is very much appreciated!

Edit: I understand that Ubuntu Precise repositories are not up-to-date (autokey 
version 0.71.2-1) and that the fix mentioned here will be in action when 
installing from up-to-date autokey repository. Sorry for the buzz.

Original comment by hella.ri...@gmail.com on 11 Apr 2013 at 12:18