stepnjump / autokey

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

Stuck in Infinite Loop #229

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an AutoKey script with this:
if window.get_active_class() in ['emacs.Emacs', 
'gnome-terminal.Gnome-terminal']:
    keyboard.send_keys('<ctrl>+d')
else:
    keyboard.send_keys('<delete>')
2. I mapped <ctrl>+d as the Hotkey for it.
3. Hold down CTRL+d for a second or two (might take less or more time on your 
computer). It will delete a number of characters then get stuck in an infinite 
loop, and no other AutoKey Hotkey will work.

What is the expected output? What do you see instead?
It shouldn't get stuck in an infinite loop, but it does.

What version of the product are you using? On what operating system?
I'm using auto-gtk 0.90.4 in Trisquel GNU/Linux.

Please provide any additional information below.
I've tried debugging it by running autokey-gtk --verbose, but I can't figure 
out where it's getting stuck.

Original issue reported on code.google.com by paul...@gmail.com on 5 Dec 2012 at 11:15

GoogleCodeExporter commented 8 years ago
You are telling it to send the same keys that trigger the script. To me, it 
makes sense that it would get stuck in an infinite loop. It's similar to 
writing code like this:

foo() { foo(); } 

For a work-around, have it send_keys('<esc>+d'), which is the same thing in 
emacs key bindings.

Original comment by Titan8...@gmail.com on 1 Mar 2013 at 5:09