Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

<< Combining actions >>

29 views
Skip to first unread message

I. Camps

unread,
May 14, 2024, 9:23:36 AM5/14/24
to autokey-users
Hello,

My Dell notebook, have the HOME/END function together with the F11/F12 keys.

I created two scripts in order to use the Fn keys as the second function:
HOME: f11 run the script containing keyboard.send_keys("<home>").
END: f12  run the script containing keyboard.send_keys("<home>").

These work fine.

Now, I need to add the combinations <shift>+HOME and <ctrl>+HOME, for example in order to select the text from the current position to the document start and to jump the document start.

Question: How can I implement both combined functions?

Regards,

Camps

Joe

unread,
May 14, 2024, 11:56:42 AM5/14/24
to autoke...@googlegroups.com

Welcome to the AutoKey community, I. Camps!

Sorry about your limited keyboard!

You should be able to use phrases to solve this without needing scripts (although scripts are fine).

I read this wrong at least twice. I think this is what you want. If not, post again and we'll get it right.

Combining hotkeys is not entirely impossible, but is probably way more than what you need here.

You need a separate phrase for each result you need to emit. Hopefully, there aren't  too many permutations.

If there are a lot, maybe some sort of fancy script would work better.

With some luck, maybe  our forum and your email client will leave the following intact. If you don't see a bunch of less than and greater than signs below, then we'll have to use another way to show it to you.

Hotkey->Phrase text

F11-><home>
F12-><end>
Shift+F11-><shift>+<home>
Ctrl+F11-><ctrl>+<home>
...


There are a few "tricks" to getting this to work.

You have to set the phrase option Paste using to Keyboard. Otherwise, it emits the literal string with "<home>", etc. in it.

Don't quote the phrase content. It's just <home>, not "<home>".

The hotkey recording pop-up needs a rewrite. Ignore the modifier key buttons at the top and just type what you want the hotkey to be. Any modifier keys you press (on your keyboard) should have their modifier buttons highlighted so you know they were seen, but actually selecting them on the screen doesn't do anything useful.

See https://github.com/autokey/autokey/wiki/Special-Keys for all the names of special keys.

This may help as well. https://github.com/autokey/autokey/wiki/Key-Combinations

Be sure to browser through the rest of our wiki. There are a number of useful articles and a lot of example scripts there.

----

A completely different way to address this (if you don't need F11 or some other key to in its default behavior) is to just remap that key to emit Home and  another one to emit End.
That is done using xmodmap or xkb. Those commands take a bit to decipher, but they work well. I have a pile of links for them if you want them.

The good thing is that they just work on everything. The bad thing is they work on everything and don't have things like AutoKey's window filters to make them only behave specially on the windows where the special behavior is desired.

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/ee268feb-f84c-46d5-a59a-8d286a9b6d48n%40googlegroups.com.

I. Camps

unread,
May 16, 2024, 4:06:39 AM5/16/24
to autokey-users
Hi Joe,

Thank you very much for your detailed help.

I could do it using scripts!

When I tried the phrase method, keeps printing <home> even with the phrase option "Paste using to Keyboard".

Camps

Joe

unread,
May 16, 2024, 4:41:00 AM5/16/24
to autoke...@googlegroups.com

Glad it works, but...

That should not happen.

I hadn't done it in a while, so I tried it out before replying to you last time and it worked fine.

Could you create a test phrase and send it to me?

If you call the phrase ictest, then I would need ictest.py and ictest.json. (If you are using an older version of AutoKey, the the second file would be .ictest.json.

By default, they will be in whatever folder you added the phrase to under $HOME/.config/autokey/data.

I think you can use small attachments in our group, but if it doesn't let you, you can put the somewhere on the web such as pastebin.com and send me a link.

What version of AutoKey are you using? It should be 0.96.0. If not, I'll show you how to upgrade to it.

What distro and release are you using? (E.G. Kubuntu 22.04) What application window is active when you trigger the phrase?

Joe

Reply all
Reply to author
Forward
0 new messages