They lock my caps on

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
philchenevert
Posts: 1
Joined: 29 Jun 2022, 20:06

They lock my caps on

Post by philchenevert » 29 Jun 2022, 20:47

I use a very simple script of AutoHotKeys to edit audio book tracks. But one key I use is the 'caps' key in conjunction with various others to delete sections, amplify sections, etc. But when I then switch to answering email or anything else, the caps are locked on. This is just irritating because I then must stop what I'm doing and 'suspend' the hot keys script before I can type normally. I really don't want to change using the caps key because I've done it for years that way. Is there any other way to not automatically lock it up?

Exposing the depth of my igornance about HotKeys, here is the script I use every day, almost all day:

Code: Select all

;delete a marked range:
SC03A & d::
{
Send, z
Send, {Delete}
Send, {Left 20}
Send, ^2
Send, {Space}
}
Return

Deamplify x3
{
SC03A & 3::
Send, !c
Send, A
Send, {Enter}
Send, -3
Send, {Enter}
Send, {Left 40}
Send, ^2
Send, {space}
Return
}
Return


;deamplify x 15
{
SC03A & 5::
Send, !c
Send, A
Send, {Enter}
Send, -15
Send, {Enter}
Send, {Left 40}
Send, ^2
Send, {space}
Return
}
Return

;amplify x 2
{
SC03A & 2::
Send, !c
Send, A
Send, {Enter}
Send, 2
Send, {Enter}
Send, {Left 03}
Send, ^2
Send, {space}
Return
}
Return

;silence a bit of track
{
SC03A & S::
Send, !g
Send, S
Send, {Enter}
Send, {Left 30}
Send, {Space}
Return
}
Return
[Mod edit: [code][/code] tags added.]

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

Re: They lock my caps on

Post by mikeyww » 29 Jun 2022, 21:01

A couple of things are surprising: first, that this script runs, due to the syntax error on line 12; and second, that CapsLock would be activated, since the script has no commands that would do that.

Your braces serve no role in AHK; I suggest deleting them. It's best if your script contains only AHK code and any comments.

RussF
Posts: 1264
Joined: 05 Aug 2021, 06:36

Re: They lock my caps on

Post by RussF » 30 Jun 2022, 05:53

@mikeyww,I believe SC03A (dec 58) is the scan code for the Caps key. Could it be that because line 12 is unreachable, the interpreter ignores it?

Russ

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

Re: They lock my caps on

Post by mikeyww » 30 Jun 2022, 05:58

Thanks. My comments may be clearer when the script is run and tested.

Post Reply

Return to “Ask for Help (v1)”