conflict between 2 files that use capslock modifiers

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
B1z2
Posts: 15
Joined: 15 Apr 2016, 11:39

conflict between 2 files that use capslock modifiers

21 May 2018, 14:09

I have 2 ahk files, lets call them "file-a" and "file-b".

File-a has bunch of capslock + key hotkeys.

File-b has capslock+u, capslock+t and capslock+shift+t hotkeys.

If I load file-b after file-a, file-b hotkeys work, but if i do reverse they don't.

Is there a way to make file-b capslock hotkeys work, even if its loaded before file-a? I would prefer not to combine both files, as file-b is quite big.

EDIT: This only happens if I put "SetCapslockState, AlwaysOff" on both files.
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: conflict between 2 files that use capslock modifiers

21 May 2018, 15:27

Both processes install a keyboard hook, which (in order to make the hotkeys/SetCapslockState work properly) disrupts the native function and the hotkeys of the other process. The process which loads the hook last will the processed first, as you have noticed. You can have a script drop and reload the hook by having it call Suspend,On and then Suspend,Of. Hooks by elevated processed are processed with higher priority too, for example if you run the script as administrator.

You don't want to combine the scripts, but would an #Include not work? Having a script require the highest priority hook sounds annoying.
B1z2
Posts: 15
Joined: 15 Apr 2016, 11:39

Re: conflict between 2 files that use capslock modifiers

22 May 2018, 01:41

I tried adding #Include [script-b-path] in script-a. It simply turns off script-a hotkeys, while turning on script-b ones....

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Giresharu, Google [Bot], inseption86, KruschenZ, mikeyww, Swiftly9767 and 287 guests