How to hold space or mouse click?

87 views
Skip to first unread message

TSSF

unread,
Jan 19, 2023, 11:12:52 AM1/19/23
to autokey-users
I tried out keyboard.release_key('<shift>') and keyboard.release_key('a').

Both work well. But keyboard.release_key('<space>') does not seem to work.

What about a mouse click? Is it possible to hold the left mouse button down with AutoKey?

Thank you so much.

TSSF

unread,
Jan 20, 2023, 12:35:16 PM1/20/23
to autokey-users
Also, being new to AutoKey, are the only options to run a script like keyboard.release_key('a') the 'run the currently selected script' / 'run current script' options in the application, and by pressing the hotkey that I set?

TSSF

unread,
Jan 21, 2023, 2:30:56 AM1/21/23
to autokey-users
Figured out space, not <space>, but type an actual space.

Remaining questions:

1. What about a mouse click? Is it possible to hold the left mouse button down with AutoKey?

2. Being new to AutoKey, are the only options to run a script like keyboard.release_key('a') the 'run the currently selected script' / 'run current script' options in app, and by pressing the hotkey that I set?

Thanks.

jos...@main.nc.us

unread,
Jan 21, 2023, 3:02:11 AM1/21/23
to autoke...@googlegroups.com
Welcome to AutoKey, TSSF!

Looking here: http://autokey.github.io/autokey/api/mouse.html, there's
currently no capability to press and hold a mouse button.

This would make a valid enhancement request if you want to file an issue.

But don't get your hopes up because we currently have severely limited
developer resources and I'm not aware of any enhancements being actively
worked on.

Joe
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/fbcd5343-7fa3-491e-a837-e4e9c3711a7bn%40googlegroups.com.
>

jos...@main.nc.us

unread,
Jan 21, 2023, 4:04:40 AM1/21/23
to autoke...@googlegroups.com
TL;DR: Those are the main ones.

The following is probably more than you ever wanted to know: :)

There is an option to add a phrase or script to the AutoKey icon context
menu. Once it's added there, you can right click on the icon in your panel
and then click on the name of the phrase/script to run it.

Getting a bit more convoluted, you can use our engine API to run a script
from within another script. You can also use the script macro to run a
script from within the text of a phrase.

You can use autokey.run. It runs an AutoKey script from an external
program such as a shell script as long as AutoKey itself is already
running.

I haven't seen anyone use any of these last three options, so there may be
undiscovered issues with them.

I run phrases and scripts from the icon context menu a lot. I have phrases
for a number of AutoKey URLs there and things that are just being tested.

If I use something infrequently, I forget its trigger abbreviation and/or
hotkey, so it's easier to find it in the context menu.

Some of these have no trigger abbreviation/hotkey assigned at all, so I
don't have to be concerned about running them accidentally by using a
trigger that I don't remember is assigned to anything. And they don't tie
up triggers that I might want to use for something else later.

BTW, I don't know exactly how AutoKey works, but I believe that any
"pressed" keys are released when the script ends. I have not verified
this.

Joe
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/94b6594d-89b5-4cda-a740-4f886b0e5608n%40googlegroups.com.
>

jos...@main.nc.us

unread,
Jan 21, 2023, 4:18:15 AM1/21/23
to autoke...@googlegroups.com
Of course, any action (phrase or script) can have one or more trigger
abbreviations. When one of these is typed followed by the appropriate
separator character, the action is triggered. There are a bunch of options
in the trigger panel which affect how this works.

It's a separate topic, but there are also window filters. If the filter
doesn't match the current active window title OR class, then AutoKey does
nothing unless another action uses the same trigger and has a window
filter that does match. By default, the window filter matches all windows.

Joe
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/39425924-62a2-47e7-bd11-dac08a36a84an%40googlegroups.com.
>

TSSF

unread,
Feb 9, 2023, 3:48:05 PM2/9/23
to autokey-users
OK. Thank you! I am not good with computers, so some of what you mentioned I do not entirely understand. But a few things you mentioned seem to be helpful. I'll definitely take a look.

jos...@main.nc.us

unread,
Feb 11, 2023, 8:34:06 AM2/11/23
to autoke...@googlegroups.com
There are lots of articles and examples in our wiki and you can always ask
here. https://github.com/autokey/autokey/wiki

Cpmputers are like onions. You have to peel them one layer at a time as
you learn (and if you bite off more than you than chew at one time, it
might be a hot onion!) :)

Joe
> https://groups.google.com/d/msgid/autokey-users/4ee7d932-1c57-4523-8c6e-eaa45781896an%40googlegroups.com.
>

jos...@main.nc.us

unread,
Feb 11, 2023, 8:49:56 AM2/11/23
to autoke...@googlegroups.com
I misspoke. There are now separate press and release API calls for the
mouse, so you can do that. However, the feature is new to AutoKey 0.96.0,
our current release, so it hasn't been used much yet and there may be some
wrinkles or bugs we haven't encountered yet.

There are some intricacies involved with API calls like the press and
release ones that are synchronous (happen right away) and most of the rest
that are asynchronous (get started and happen some short time later), so
if you need to mix them, that will take some extra understanding and a bit
of extra coding that's not obvious, so ask about that if you need to do
it.

Joe
> https://groups.google.com/d/msgid/autokey-users/edff292d023eff082e138c150af93539.squirrel%40www.main.nc.us.
>

Reply all
Reply to author
Forward
0 new messages