Hello,
Is there a way to turn a normally non-modifier key into a modifier key to trigger AHK commands?
For example, my current modifier keys (as far as I know) are Shift, Alt, Ctrl and Win. Suppose I want to begin using my Pause/Break key (which I seldom use for anything) as an additional modifier -- i.e. so that I can use key combos such as the following to function as hotkeys:
Pause+1
Pause+2
Pause+F1
Pause+F2
and so on...
in the same way I can currently use Shift, Alt, Ctrl, etc:
Shift+1
Alt+2
Ctrl+F1
Ctrl+F2
Is that possible?
If so, how is it done?
Thanks
Create additional modifier keys
Started by
dsavant
, Mar 02 2011 05:03 PM
6 replies to this topic
#1
-
Posted 02 March 2011 - 05:03 PM
"A person who has never made a mistake is a person who has never tried anything new." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein
1 & Pause::msg() 2 & Pause::msg() F1 & Pause::msg() F2 & Pause::msg() ; etc etc... msg(){ msgbox % "You pressed " a_thisHotkey }
#3
-
Posted 02 March 2011 - 05:28 PM
don't duplicate, iterate!
What a helpful guest
To add some helpfulness to dsavant:
Elegant, right?
I was a bit curious about how to achieve this myself, since some people - for unknown reasons - have, euhm, "unique" wishes for hotkey combinations. My father wanted to hotkey the webpage that shows tv-times to the hotkey combination t+v, for example.
The problem with an implementation that easy would of course be that one of those keys lost their normal push-down-behaviour (and instead send their corresponding text on key release). Is there any way to get around that?
EDIT:
Not-so-elegant with the backspace. "Regret last sent key", any better way to do it? Else I'd have to design a solution based upon active window class, I guess.
To add some helpfulness to dsavant:
Pause & W::MsgBox You pressed Pause+W! Pause::Send {Pause}.
Elegant, right?
I was a bit curious about how to achieve this myself, since some people - for unknown reasons - have, euhm, "unique" wishes for hotkey combinations. My father wanted to hotkey the webpage that shows tv-times to the hotkey combination t+v, for example.
The problem with an implementation that easy would of course be that one of those keys lost their normal push-down-behaviour (and instead send their corresponding text on key release). Is there any way to get around that?
EDIT:
~t & v:: Send {backspace} ; Added so that the "TV" combo doesn't produce a T MsgBox Wanna see some TV? return
Not-so-elegant with the backspace. "Regret last sent key", any better way to do it? Else I'd have to design a solution based upon active window class, I guess.
#4
-
Posted 02 March 2011 - 05:32 PM
Thanks for response
This seems backwards from my question but I do appreciate you showing me what
"Key1 & Key2::..."
can do.
Thanks
1 & Pause::msg() 2 & Pause::msg() F1 & Pause::msg() F2 & Pause::msg() ; etc etc...
This seems backwards from my question but I do appreciate you showing me what
"Key1 & Key2::..."
can do.
Thanks
#5
-
Posted 03 March 2011 - 01:05 AM
"A person who has never made a mistake is a person who has never tried anything new." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein
Thanks a bunch sumon! That's the 2nd great reply you have given me today. It works just as I need and does not render the involved keys unusable as was the case above. I also appreciate the:Pause & W::MsgBox You pressed Pause+W! Pause::Send {Pause}.
Pause::Send {Pause}
line. I don't know if I would have figured that out.
One more thing: because of paralysis in both of my hands, I benefit tremendously by the Sticky Keys option in Windows. Is there a way to work that into the code you shared?
Thanks again.
#6
-
Posted 03 March 2011 - 01:16 AM
"A person who has never made a mistake is a person who has never tried anything new." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein
You're welcome, thanks for the appreciation. To me it seems like the Askforhelp forum is the more active at the moment, and since I am currently out of scriptinginspiration I forumlurk, I bet.
Anyway, I think you'd need some special solution to accomodate for your hands. Hotkeys and paralyzis doesn't sound too sweet. It's actually weird that stickyness isn't more supported, as I think most of us could use it for the hardtoreach-combos.
From KeyWait
Anyway, I think you'd need some special solution to accomodate for your hands. Hotkeys and paralyzis doesn't sound too sweet. It's actually weird that stickyness isn't more supported, as I think most of us could use it for the hardtoreach-combos.
$Pause:: ; The § should prevent Pause from triggering itself KeyWait, W, D T3 ; T3 gives you three seconds to press W if (Errorlevel) Send {Pause} ; By the way, this is really just necessary if you wanna preserve the original pause functionality else MsgBox You pressed Pause+W! return
From KeyWait
#7
-
Posted 03 March 2011 - 01:36 AM