Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
73 views
in Technique[技术] by (71.8m points)

How to get the actual hotstring typed with capitalization in AutoHotKey?

I am using hotstrings in AutoHotKey and the output is reliant on if characters are capitalized. Is there a way to determine if characters in the keys typed that triggered the hotkey are capitalized? I tried using A_ThisHotkey, but it does not seem to be case sensitive. Please let me know if you have a solution. Thanks.

question from:https://stackoverflow.com/questions/65865638/how-to-get-the-actual-hotstring-typed-with-capitalization-in-autohotkey

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm not aware of a built in way to do this, but maybe you'd be fine with just creating more hotstrings and using the C option for case sensitivity like this:

:C:hello::
:C:Hello::
:C:HeLLo::
:C:HELLO::
    MsgBox, % A_ThisHotkey
return

Example request from comments:

hotstrings := "hello,HELLO,HeLlo,HellO,hElLo,hellO"
for each, hotstring in StrSplit(hotstrings, ",")
    Hotstring(":CB0*?:" hotstring, Func("MyFunction"))
return

MyFunction()
{
    MsgBox, % "Hotstring triggered!`n" A_ThisHotkey
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

Just Browsing Browsing

[5] html - How to create even cell spacing within a

2.1m questions

2.1m answers

60 comments

57.0k users

...