Ignore All Hotkeys AutoHotKey
up vote
0
down vote
favorite
CODE
currentstring := ""
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
*::
return
return
t::
MsgBox,,,%currentstring%,3
return
But when I am in the InputBox and I press q
,w
,e
,r
, or t
, it executes the code before the return, even though I already override the hotkeys by *::
.
Is there any fix to this?
autohotkey
add a comment |
up vote
0
down vote
favorite
CODE
currentstring := ""
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
*::
return
return
t::
MsgBox,,,%currentstring%,3
return
But when I am in the InputBox and I press q
,w
,e
,r
, or t
, it executes the code before the return, even though I already override the hotkeys by *::
.
Is there any fix to this?
autohotkey
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
CODE
currentstring := ""
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
*::
return
return
t::
MsgBox,,,%currentstring%,3
return
But when I am in the InputBox and I press q
,w
,e
,r
, or t
, it executes the code before the return, even though I already override the hotkeys by *::
.
Is there any fix to this?
autohotkey
CODE
currentstring := ""
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
*::
return
return
t::
MsgBox,,,%currentstring%,3
return
But when I am in the InputBox and I press q
,w
,e
,r
, or t
, it executes the code before the return, even though I already override the hotkeys by *::
.
Is there any fix to this?
autohotkey
autohotkey
asked 2 days ago
MilkyWay90
7610
7610
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
*::
is not a "catch all" hotkey, it just fires when it detects an asterisk (normally Shift+8).
To achieve your desired effect, you should activate the hotkeys based on the active window.
Working Example
If the active window is an InputBox
(ahk_class #32270
), disable the hotkeys, but don't block their native function (the ~
prefix). If not the InputBox
, bind the hotkeys as desired.
#SingleInstance force
currentstring := ""
return ; end auto-execute section
#IfWinActive, ahk_class #32770 ; If an InputBox window, restore default key function
~q::
~w::
~e::
~r::
~t::
return
#IfWinActive ; If anything else
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
return
t::
MsgBox,,,%currentstring%,3
return
Notes:
- It is considered best practice to only bind the hotkeys you need, not to everything.
- To determine a Window's properties (class, id, etc.), you can use the Active Window Info or Window Spy tool bundled with AutoHotKey. It can also be launched from the system tray icon of a running script if
Menu, Tray, NoStandard
has not been used.
Thank you! What does #SingleInstance force do?
– MilkyWay90
2 days ago
Makes sure that only one of this program is running at a time. By default whenever I'm working with hotkeys it's useful to make sure you've only got one version running at a time.#SingleInstance
– samthecodingman
2 days ago
Okay! Normally it just gives a warning and I shut down the older instance. Thanks for the tip, though!
– MilkyWay90
11 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
*::
is not a "catch all" hotkey, it just fires when it detects an asterisk (normally Shift+8).
To achieve your desired effect, you should activate the hotkeys based on the active window.
Working Example
If the active window is an InputBox
(ahk_class #32270
), disable the hotkeys, but don't block their native function (the ~
prefix). If not the InputBox
, bind the hotkeys as desired.
#SingleInstance force
currentstring := ""
return ; end auto-execute section
#IfWinActive, ahk_class #32770 ; If an InputBox window, restore default key function
~q::
~w::
~e::
~r::
~t::
return
#IfWinActive ; If anything else
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
return
t::
MsgBox,,,%currentstring%,3
return
Notes:
- It is considered best practice to only bind the hotkeys you need, not to everything.
- To determine a Window's properties (class, id, etc.), you can use the Active Window Info or Window Spy tool bundled with AutoHotKey. It can also be launched from the system tray icon of a running script if
Menu, Tray, NoStandard
has not been used.
Thank you! What does #SingleInstance force do?
– MilkyWay90
2 days ago
Makes sure that only one of this program is running at a time. By default whenever I'm working with hotkeys it's useful to make sure you've only got one version running at a time.#SingleInstance
– samthecodingman
2 days ago
Okay! Normally it just gives a warning and I shut down the older instance. Thanks for the tip, though!
– MilkyWay90
11 hours ago
add a comment |
up vote
0
down vote
accepted
*::
is not a "catch all" hotkey, it just fires when it detects an asterisk (normally Shift+8).
To achieve your desired effect, you should activate the hotkeys based on the active window.
Working Example
If the active window is an InputBox
(ahk_class #32270
), disable the hotkeys, but don't block their native function (the ~
prefix). If not the InputBox
, bind the hotkeys as desired.
#SingleInstance force
currentstring := ""
return ; end auto-execute section
#IfWinActive, ahk_class #32770 ; If an InputBox window, restore default key function
~q::
~w::
~e::
~r::
~t::
return
#IfWinActive ; If anything else
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
return
t::
MsgBox,,,%currentstring%,3
return
Notes:
- It is considered best practice to only bind the hotkeys you need, not to everything.
- To determine a Window's properties (class, id, etc.), you can use the Active Window Info or Window Spy tool bundled with AutoHotKey. It can also be launched from the system tray icon of a running script if
Menu, Tray, NoStandard
has not been used.
Thank you! What does #SingleInstance force do?
– MilkyWay90
2 days ago
Makes sure that only one of this program is running at a time. By default whenever I'm working with hotkeys it's useful to make sure you've only got one version running at a time.#SingleInstance
– samthecodingman
2 days ago
Okay! Normally it just gives a warning and I shut down the older instance. Thanks for the tip, though!
– MilkyWay90
11 hours ago
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
*::
is not a "catch all" hotkey, it just fires when it detects an asterisk (normally Shift+8).
To achieve your desired effect, you should activate the hotkeys based on the active window.
Working Example
If the active window is an InputBox
(ahk_class #32270
), disable the hotkeys, but don't block their native function (the ~
prefix). If not the InputBox
, bind the hotkeys as desired.
#SingleInstance force
currentstring := ""
return ; end auto-execute section
#IfWinActive, ahk_class #32770 ; If an InputBox window, restore default key function
~q::
~w::
~e::
~r::
~t::
return
#IfWinActive ; If anything else
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
return
t::
MsgBox,,,%currentstring%,3
return
Notes:
- It is considered best practice to only bind the hotkeys you need, not to everything.
- To determine a Window's properties (class, id, etc.), you can use the Active Window Info or Window Spy tool bundled with AutoHotKey. It can also be launched from the system tray icon of a running script if
Menu, Tray, NoStandard
has not been used.
*::
is not a "catch all" hotkey, it just fires when it detects an asterisk (normally Shift+8).
To achieve your desired effect, you should activate the hotkeys based on the active window.
Working Example
If the active window is an InputBox
(ahk_class #32270
), disable the hotkeys, but don't block their native function (the ~
prefix). If not the InputBox
, bind the hotkeys as desired.
#SingleInstance force
currentstring := ""
return ; end auto-execute section
#IfWinActive, ahk_class #32770 ; If an InputBox window, restore default key function
~q::
~w::
~e::
~r::
~t::
return
#IfWinActive ; If anything else
q::
ExitApp
return
w::
MsgBox,,,Hello`, World!,3
return
e::
MsgBox,,,Hello World,3
return
r::
InputBox, currentstring
return
t::
MsgBox,,,%currentstring%,3
return
Notes:
- It is considered best practice to only bind the hotkeys you need, not to everything.
- To determine a Window's properties (class, id, etc.), you can use the Active Window Info or Window Spy tool bundled with AutoHotKey. It can also be launched from the system tray icon of a running script if
Menu, Tray, NoStandard
has not been used.
answered 2 days ago
samthecodingman
1,224813
1,224813
Thank you! What does #SingleInstance force do?
– MilkyWay90
2 days ago
Makes sure that only one of this program is running at a time. By default whenever I'm working with hotkeys it's useful to make sure you've only got one version running at a time.#SingleInstance
– samthecodingman
2 days ago
Okay! Normally it just gives a warning and I shut down the older instance. Thanks for the tip, though!
– MilkyWay90
11 hours ago
add a comment |
Thank you! What does #SingleInstance force do?
– MilkyWay90
2 days ago
Makes sure that only one of this program is running at a time. By default whenever I'm working with hotkeys it's useful to make sure you've only got one version running at a time.#SingleInstance
– samthecodingman
2 days ago
Okay! Normally it just gives a warning and I shut down the older instance. Thanks for the tip, though!
– MilkyWay90
11 hours ago
Thank you! What does #SingleInstance force do?
– MilkyWay90
2 days ago
Thank you! What does #SingleInstance force do?
– MilkyWay90
2 days ago
Makes sure that only one of this program is running at a time. By default whenever I'm working with hotkeys it's useful to make sure you've only got one version running at a time.
#SingleInstance
– samthecodingman
2 days ago
Makes sure that only one of this program is running at a time. By default whenever I'm working with hotkeys it's useful to make sure you've only got one version running at a time.
#SingleInstance
– samthecodingman
2 days ago
Okay! Normally it just gives a warning and I shut down the older instance. Thanks for the tip, though!
– MilkyWay90
11 hours ago
Okay! Normally it just gives a warning and I shut down the older instance. Thanks for the tip, though!
– MilkyWay90
11 hours ago
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418059%2fignore-all-hotkeys-autohotkey%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown