Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Toggle WASD keys to Arrow keys help


  • Please log in to reply
7 replies to this topic
GamerDude
  • Guests
  • Last active:
  • Joined: --
So... How would I make a script that toggles the WASD Keys to Arrow keys?

I have it look like this:

tab::

pressed := !pressed
If pressed {

MsgBox, 1,, Arrow Keys to WASD Keys Toggled on

w::
sleep, 10
SendInput {up down}
;sleep, 200
SendInput {up up}
sleep, 10
Return

a::
sleep, 10
SendInput {left down}
;sleep, 200
SendInput {left up}
sleep, 10
Return

s::
sleep, 10
SendInput {down down}
sleep, 200
SendInput {down up}
sleep, 10
Return

d::
sleep, 10
SendInput {right down}
sleep, 200
SendInput {right up}
sleep, 10
Return

        }



Else

MsgBox, 1,, Arrow Keys to WASD Keys Toggled off
Return

But The hotkeys work when the it's toggled on or off... How do I fix it?

None
  • Members
  • 3199 posts
  • Last active: Nov 05 2015 09:55 PM
  • Joined: 28 Nov 2009
Example that uses CapsLock as the Toggle 8)
$w::

If GetKeyState("CapsLock","T")

Send {Up}

else

Send w

Return


VxE
  • Moderators
  • 3622 posts
  • Last active: Dec 24 2015 02:21 AM
  • Joined: 07 Oct 2006
Gui, 92:+Owner

Gui, 92:Show, y-99999 NoActivate, [VxE] says to change QWEASD to H^E<v>

#UseHook



~CapsLock::Gui, % "92:" ( GetKeyState("Capslock", "t") ? "Show" : "Cancel" ), NoActivate



#IfWinExist, [VxE] says to change QWEASD to H^E<v>

;	q::Home

	w::Up

;	e::End

	a::Left

	s::Down

	d::Right

#IfWinExist ; end context-hotkeys section
:?:

TheGreatSwami Woo
  • Members
  • 237 posts
  • Last active: Jan 22 2012 03:31 PM
  • Joined: 26 May 2011
@VxE
you version is great but I am not sure it is fully working?
Is there supposed to be a tooltip to let you know when you are in command mode (when capslock is down)? As it is not showing on my screen.
I would like something like
ToolTip, *** Command mode ***, 0, 0
but although I have it working in my own capslock script I dont know where to put it in yours!
ps I dont see the point of putting one line of code in code tags!

jpjazzy
  • Members
  • 800 posts
  • Last active: Dec 17 2014 07:22 AM
  • Joined: 16 Feb 2010
Gui, 92:+Owner

Gui, 92:Show, y-99999 NoActivate, [VxE] says to change QWEASD to H^E<v>

#UseHook



~CapsLock::

Gui, % "92:" ( GetKeyState("Capslock", "t") ? "Show" : "Cancel" ), NoActivate

ToolTip, % ( GetKeyState("Capslock", "t") ? "Arrow keys are active." : "Arrow keys disabled.")

SetTimer, TooltipOff, -2000 ; Turns off the tooltip off after 2 seconds 

return



TooltipOff:

ToolTip

return



#IfWinExist, [VxE] says to change QWEASD to H^E<v>

;   q::Home

   w::Up

;   e::End

   a::Left

   s::Down

   d::Right

#IfWinExist ; end context-hotkeys section


AutoHotkey Basic - Windows 7
Posted Image

TheGreatSwami Woo
  • Members
  • 237 posts
  • Last active: Jan 22 2012 03:31 PM
  • Joined: 26 May 2011
Thanks at first I thougnt it wasnt working but I see I had changed something from the original script, thanks
ps Love your ahknet page 8)

jpjazzy
  • Members
  • 800 posts
  • Last active: Dec 17 2014 07:22 AM
  • Joined: 16 Feb 2010
Thanks. Most of that was generated by Uberi's webpage generator.
AutoHotkey Basic - Windows 7
Posted Image

Honest Abe
  • Members
  • 310 posts
  • Last active: Jan 08 2015 08:56 PM
  • Joined: 07 Jan 2011
For those using AHK_L

#If GetKeyState("CapsLock", "T")

w::up
s::down
a::left
d::right

#If

Win7 (x64)
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File