Jump to content


Photo

Access to hotstring typed


  • Please log in to reply
5 replies to this topic

#1 cool-RR

cool-RR
  • Members
  • 83 posts

Posted 19 July 2012 - 07:18 PM

Hi,

I'm inside the function that handles a hotstring. I want to see the hotstring exactly as it was typed, so I could know which letters where capitalized and which weren't. A hotstring like "btw" could be typed "Btw" or "BTW" or "bTW". Does AHK let me access that inside a function that handles a hotstring?


Thanks,
Ram.

#2 dylan904

dylan904
  • Members
  • 706 posts

Posted 19 July 2012 - 08:22 PM

Sure, well what you would do is make a list of your *case-sensitive* hotkey for your hotstring like so...
:C:Btw::
:C:BTW::
:C:bTW::
:C:BTw::
:C:btw::
MsgBox % "You typed " SubStr(A_thishotkey, 4)
return
A_ThisHotkey is a built-in variable containing the hotkey that triggered the current thread.
The prefix :C: is to make the hotstring case-sensitve.
You have to do a SubString to overlook the :C: prefix of the hotkey.

#3 cool-RR

cool-RR
  • Members
  • 83 posts

Posted 19 July 2012 - 08:50 PM

Thank you, but that does not solve the problem. I want to get the exact form that the hotstring was typed in *without* having to list all the permutations like that.

#4 dylan904

dylan904
  • Members
  • 706 posts

Posted 19 July 2012 - 09:13 PM

Alright, in that case you would use the Input command like so...
#SingleInstance Force
Input, Typed, V,,btw
If (ErrorLevel = "Match")
   MsgBox You pressed %Typed%


#5 Leef_me

Leef_me
  • Moderators
  • 7704 posts

Posted 19 July 2012 - 10:20 PM

I'm inside the function that handles a hotstring. I want to see the hotstring exactly as it was typed, so I could know which letters where capitalized and which weren't. A hotstring like "btw" could be typed "Btw" or "BTW" or "bTW". Does AHK let me access that inside a function that handles a hotstring?


The capability does not exist. Characters are converted to lower case.

#6 cool-RR

cool-RR
  • Members
  • 83 posts

Posted 20 July 2012 - 01:42 PM

Thanks everybody!