Using Windows Key as a Hotkey?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
playerinfinity707
Posts: 23
Joined: 28 Dec 2021, 01:37

Using Windows Key as a Hotkey?

Post by playerinfinity707 » 28 May 2023, 02:09

I can't seem to make this code work to record and pause audio in Audacity. Any ideas? :?:

Code: Select all

#If WinExist("ahk_exe Audacity.exe")
LWin::                                        ;Record
LAlt::                                        ;Pause
  ControlSend ,,% {"LWin":"r","LAlt":"p"}[A_ThisHotkey],ahk_exe Audacity.exe
Return

Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Using Windows Key as a Hotkey?

Post by Rohwedder » 28 May 2023, 02:40

Hallo,
here it works.
Perhaps?:

Code: Select all

#If WinExist("ahk_exe Audacity.exe") ; Version 2.4.2
LWin::ControlSend, wxWindowNR11, r,ahk_exe Audacity.exe  ;Record
LAlt::ControlSend, wxWindowNR6, p,ahk_exe Audacity.exe   ;Pause
or:

Code: Select all

#If WinExist("ahk_exe Audacity.exe") ; Version 3.3.2
LWin::ControlSend, wxWindowNR17, r,ahk_exe Audacity.exe  ;Record
LAlt::ControlSend, wxWindowNR12, p,ahk_exe Audacity.exe  ;Pause

Post Reply

Return to “Ask for Help (v1)”