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?

  • 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 3: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 3:15
  • Well i did the editing for you – Videonauth May 18 '16 at 3: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 3: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 3:29

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

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – Videonauth May 20 '16 at 16:03
  • 2
    @Videonauth I am the author. Since the comment thread in question was very long, I provided the answer here to provide visibility for others who may be facing similar issue. – q126y May 20 '16 at 16:13
  • 2
    @Videonauth: I disagree. A question "how can I achieve A through B?" may very well have the answer "A is unachievable through B". If you disagree with that assessment it still remains an answer as per the guidelines of AU. Wrong™ answers are still answers. – David Foerster May 23 '16 at 13:07
  • 1
  • 1
    @Videonauth How frustrating : / – Nick Weinberg Jun 30 '16 at 19:36

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>")
  • You should add some delay between each keystrokes with this command: time.sleep(0.1) – Danyl Bekhoucha May 2 '17 at 18:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.