TaranVH / 2nd-keyboard

ALL of Taran's scripts - not just for the 2nd keyboard.
https://www.youtube.com/watch?v=O6ERELse_QY
1.66k stars 534 forks source link

AHK (Or iCUE?) can't differentiate between Corsair macro keyboard and normal keyboard #171

Closed BacKinnn closed 1 year ago

BacKinnn commented 1 year ago

Hi guys, I've been trying to set AHK recently (2 days) by using my Corsair keyboard (model K63) as a macro keyboard. I haven't touched anything to my normal keyboard, which just a normal office board, different from the macro one. I did read the AHK tutorial and understand basic concepts like hotkeys, hot strings, functions, etc. Then I download the "iCue_F24_macro_keyboard.ahk" file, and adding codes from "ALL_MULTIPLE_KEYBOARD_ASSIGNMENTS.ahk", "Almost_All_Premiere_Functions.ahk" and "Almost_All_Windows_Functions.ahk".

I tried to put together some hotkeys for switching programs like Firefox and Premiere, nothing happen so far. But after adding "Instant cut at cursor" macro from "ALL_MULTIPLE_KEYBOARD_ASSIGNMENTS.ahk" (assigned to z) to use in Premiere, my main keyboard start using the script as well (by tooltip message popping up). After that, can't use my main keyboard normally anymore, and I have to exit the script.

So now I'm really confused, I already:

Does defining custom functions in the end of file and then call them on hotkey is the only way to make the script work? Or do I messed up something at the start of the file or in the custom functions at the end? Or does the macro include shortcuts that shouldn't be pressed as a standalone key (E.g. "Selection tool" is assign to "V") make this script broken?

Can someone look through my code and tell me what's wrong? Also, is there any helpful debugging tools besides tooltip? I really appreciate the time you read till this point, thank you.

Here is the code: iCue_F24_macro_keyboard.txt

BacKinnn commented 1 year ago

Found a fix. Change this line: "#IfWinActive ahk_exe Adobe Premiere Pro.exe" to this "if WinActive("ahk_exe Adobe Premiere Pro.exe")" I guess "#If" is outdated?