 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
GamerDude Guest
|
Posted: Sat Mar 20, 2010 2:44 am Post subject: Toggle WASD keys to Arrow keys help |
|
|
So... How would I make a script that toggles the WASD Keys to Arrow keys?
I have it look like this:
| Code: |
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? |
|
| Back to top |
|
 |
None
Joined: 28 Nov 2009 Posts: 3086
|
Posted: Sat Mar 20, 2010 3:07 am Post subject: |
|
|
Example that uses CapsLock as the Toggle | Code: | $w::
If GetKeyState("CapsLock","T")
Send {Up}
else
Send w
Return |
|
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 3254 Location: Simi Valley, CA
|
Posted: Sun Mar 21, 2010 12:08 am Post subject: |
|
|
| Code: | 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 |  _________________ Ternary (a ? b : c) guide TSV Table Manipulation Library
Post code inside [code][/code] tags! |
|
| Back to top |
|
 |
TheGreatSwami Woo
Joined: 26 May 2011 Posts: 237 Location: uk
|
Posted: Wed Dec 07, 2011 9:04 am Post subject: |
|
|
@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! |
|
| Back to top |
|
 |
jpjazzy
Joined: 16 Feb 2010 Posts: 799 Location: SciTE
|
Posted: Wed Dec 07, 2011 9:15 am Post subject: |
|
|
| Code: | 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
 |
|
| Back to top |
|
 |
TheGreatSwami Woo
Joined: 26 May 2011 Posts: 237 Location: uk
|
Posted: Wed Dec 07, 2011 9:46 am Post subject: |
|
|
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  |
|
| Back to top |
|
 |
jpjazzy
Joined: 16 Feb 2010 Posts: 799 Location: SciTE
|
Posted: Wed Dec 07, 2011 6:51 pm Post subject: |
|
|
Thanks. Most of that was generated by Uberi's webpage generator. _________________ AutoHotkey Basic - Windows 7
 |
|
| Back to top |
|
 |
Honest Abe
Joined: 07 Jan 2011 Posts: 265 Location: The American Dream
|
Posted: Wed Dec 07, 2011 7:18 pm Post subject: |
|
|
For those using AHK_L
| Code: | #If GetKeyState("CapsLock", "T")
w::up
s::down
a::left
d::right
#If |
_________________ Win7 (x64) AutoHotkey_L v1.1.05.06
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|