Problem with suspend mapped combinations

Get help with using AutoHotkey and its commands and hotkeys
dsewq1LYJ
Posts: 114
Joined: 26 Aug 2014, 23:21

Problem with suspend mapped combinations

25 Oct 2017, 09:55

Think about follow code

Code: Select all

Esc & w::do_something()
Esc & a::do_something()
Esc & s::do_something()
Esc & d::do_something()
!w::do_something()
!a::do_something()
!s::do_something()
!d::do_something()
#IfWinActive ahk_class SUSPEND_THEM
~Esc & w::return // This line cause Esc & w send nothing, it should send char 'w'.
~Esc & a::return // This line cause Esc & a send nothing, it should send char 'a'.
~Esc & s::return // This line cause Esc & s send nothing, it should send char 's'.
~Esc & d::return // This line cause Esc & d send nothing, it should send char 'd'.
~!w::return // This line works perfectly
~!a::return // This line works perfectly
~!s::return // This line works perfectly
~!d::return // This line works perfectly
#If
It sure suspend those 4 combination.
then when I press Esc & w/a/s/d, it should send 'w/a/s/d'. but it didn't.

Why !? Am I doing something wrong !?
Rohwedder
Posts: 3087
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Problem with suspend mapped combinations

25 Oct 2017, 10:30

Hallo,
try:

Code: Select all

#IfWinActive ahk_class SUSPEND_THEM
~Esc & ~w::return
~Esc & ~a::return
~Esc & ~s::return
~Esc & ~d::return
but better:

Code: Select all

#IfWinNotActive ahk_class SUSPEND_THEM
Esc & w::do_something()
Esc & a::do_something()
Esc & s::do_something()
Esc & d::do_something()
!w::do_something()
!a::do_something()
!s::do_something()
!d::do_something()
#If
dsewq1LYJ
Posts: 114
Joined: 26 Aug 2014, 23:21

Re: Problem with suspend mapped combinations

02 Jan 2018, 07:58

Rohwedder wrote:Hallo,
try:

Code: Select all

#IfWinActive ahk_class SUSPEND_THEM
~Esc & ~w::return
~Esc & ~a::return
~Esc & ~s::return
~Esc & ~d::return
but better:

Code: Select all

#IfWinNotActive ahk_class SUSPEND_THEM
Esc & w::do_something()
Esc & a::do_something()
Esc & s::do_something()
Esc & d::do_something()
!w::do_something()
!a::do_something()
!s::do_something()
!d::do_something()
#If
The first case is so much better than second case.

Thank you so much bro :xmas:

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, Baby Flurry Heart, Bruce27, Clemens375, himanshu, Rohwedder, songdg and 142 guests