0

I have just recently installed Autokey.

The first thing I would like to do if to create a shortcut for openning the terminal in a folder.

By hand this is achieved with Shift + F10 + E.

In autokey I have the following script:

keyboard.press_key('<shift>')
keyboard.press_key('<f10>')
keyboard.release_key('<f10>')
keyboard.release_key('<shift>')
keyboard.press_key('<e>')
keyboard.release_key('<e>')

But this is not working. I would appreciate some help!

Best Regards

Manuel Oliveira
  • 123
  • 1
  • 6
  • 1
    Does this answer your question? [Keyboard shortcut for "open a terminal here"](https://askubuntu.com/questions/68078/keyboard-shortcut-for-open-a-terminal-here) – CrazyTux Sep 11 '21 at 11:59
  • Thanks for the information, but I would like to do this with autokey – Manuel Oliveira Sep 11 '21 at 14:41
  • Any good reason why you want to go the less direct and thus less reliable way of an Autokey macro? Beware that, for Shift+F10 to work, a folder must be selected. – vanadium Sep 13 '21 at 11:07
  • Try changing `''` for `'e'`. Also in AutoKey go to Settings and check Show log view. Did you set a Hotkey for the shortcut? If so use the Hotkey and check the log. Running your script (with `'e'`) I had the following error : `RuntimeError: release unlocked lock`. If I use `` the log also show `Unknown key name `. You can try keyboard remapping with `My Phrases`. For example : I use the key (Hotkey) to select all. For this I write `+a` in the edit box. Try ++e. I've tested the version 0.96.0-beta.9 (actual release is 0.95.10).Your script doesn't work here too. – Gounou Sep 13 '21 at 13:58
  • I was able to do it with `keyboard.send_keys(' + e')`. Would you be so kind as to also try it on your side? – Manuel Oliveira Sep 14 '21 at 08:01
  • In my Ubuntu 21.04 Gnome the shortcut to open a terminal here is `+t`. I try with `send_keys +t` but it doesn't work. In Ubuntu 19.10 Gnome the shortcut is `menu +e` but I can't install AutoKey (it's on VirtualBox and the installation is broken). I had the same error `RuntimeError: release unlocked lock` with `send_keys` on Linux Mint 20.02. – Gounou Sep 16 '21 at 22:38

0 Answers0