4

I want to send alt+f7 keys from autokey. Following are the code samples which I tried:

  • keyboard.send_keys("<alt>+<f7>")

  • keyboard.send_key("<alt>+<f7>")

  • keyboard.fake_keypress("<alt>+<f7>")

I tried with repeat=1 also. It doesn't seem to work. Can anyone tell me how to make this work?

Videonauth
  • 33,355
  • 17
  • 105
  • 120
q126y
  • 299
  • Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. – Videonauth May 18 '16 at 03:00
  • @Videonauth I don't know how I could clarify more? I want to send alt+f7 keys from autokey. I have also included the code samples which I tried. – q126y May 18 '16 at 03:15
  • Well i did the editing for you – Videonauth May 18 '16 at 03:23
  • @Videonauth thanks. But I was corrected one time on stack overflow for superfluous information. autokey mentioned in title as well as tag. Is the etiquette different here? – q126y May 18 '16 at 03:26
  • 1
    Well, we dont want stories about your pet and children in questions, but not everyone looks directly at the tag, so adding a little sentence about what you want to achieve and what you tried isn't superfluous. And you only had the tag which made it almost impossible to determine whats going on. – Videonauth May 18 '16 at 03:29

3 Answers3

4

This script worked for me on Ubuntu 18.04 and autokey-gtk 0.90.4:

keyboard.press_key('<alt>')
keyboard.fake_keypress('<f7>')
keyboard.release_key('<alt>')

I observe about a second delay though before the script executes. Maybe its just on my computer.

0

It seems that Ubuntu 16.04 doesn't allow the system wide keyboard shortcuts to be emulated by autokey.

q126y
  • 299
0

Autokey scripts are plain Python files. Autokey uses Python scripting engine. So please check your script by running directly in Python and if it works there then it will work in Autokey too.

You can also try

keyboard.press_key("<alt>")
keyboard.send_keys("<f7>")
keyboard.release_key("<alt>")
dhiya
  • 953