Double action key

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
czetwer
Posts: 3
Joined: 17 May 2023, 08:04

Double action key

Post by czetwer » 17 May 2023, 08:15

Greetings fellow autohotkeyers,

I need help creating a script. When you press " ` " once i need to send " CTRL+`" when you double click (fast) it i need to send "ALT+`" is this possible?

Regards

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Double action key

Post by mikeyww » 17 May 2023, 09:54

Welcome to this AutoHotkey forum!

Example

czetwer
Posts: 3
Joined: 17 May 2023, 08:04

Re: Double action key

Post by czetwer » 30 May 2023, 04:06

Hi thanks for that! :)

Can I assign autohotkey to specific application? I want to use shortcuts in cad and when im not in that cad i want keybinds to be disabled. Is that possible?

Regards

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Double action key

Post by mikeyww » 30 May 2023, 04:41

Yes. Example

czetwer
Posts: 3
Joined: 17 May 2023, 08:04

Re: Double action key

Post by czetwer » 31 May 2023, 00:56

Thank you for that. I encountered a problem with my CAD application, TopSolid 6, as it does not have a consistent AHK_CLASS. I used this script to retrieve the AHK_CLASS from TopSolid:

1::WinGetClass, Clipboard, A ; This script will copy the AHK_CLASS of the active window to the clipboard.

However, I received the following outcomes:

Afx:00007FF704CD0000:8:0000000000000000:0000000000000006:0000000000470849
Afx:00007FF704CD0000:8:0000000000000000:0000000000000006:00000000001209F5
Afx:00007FF704CD0000:8:0000000000000000:0000000000000006:00000000000F0B6B

Assigning the script to this AHK_CLASS is impossible, as it would need to be done manually every time.

Is there a workaround for this issue?

Regards

User avatar
boiler
Posts: 16769
Joined: 21 Dec 2014, 02:44

Re: Double action key

Post by boiler » 31 May 2023, 03:08

You can either put the following at the top of your script and then only include the part of the class name that is consistent after ahk_class:

Code: Select all

SetTitleMatchMode "RegEx"

…or use the process name with ahk_exe instead of the class name with ahk_class. You can find the process name (and the class name) using the Window Spy tool that comes with AHK.

Reference: WinTitle

Post Reply

Return to “Ask for Help (v2)”