Hi,
I'm a semi-decent coder who has been having a lot of trouble trying to create both a toggle to hold down the shift key, as well as a simple trigger to engage holding down the shift key. The specific scenario is that I want to be able to sometimes sprint, in combat, in the MMO Age of Conan, and I'd like to be able to do so by a simple toggle switch, OR if I've hit a certain key (not a toggle, though, because it'll always activate, but the toggle switch will turn it off).
The problem is, if you do something like:
send +w (since I am using WASD keyboard), it will glitch out and not let you run.
w::+w would work, except that I couldn't toggle it, and I can't use reload, or my other macros will get messed up, and pause is just a big mess.
Help!
Thanks,
Zack
PS: and no, using capslock doesn't work, lol.
Toggle Holding Down the Shift Key
Started by
zackyang
, Jan 04 2009 06:17 AM
7 replies to this topic
#1
-
Posted 04 January 2009 - 06:17 AM
What is it that you want from us? I know, bad start, but let's move past that.
It seems that "w" will walk and "shift + w" will sprint, or reverse, right? You then want to have a key to be the toggle. If I'm going way out on left field, please tell me, because I'm lost.
Please elaborate on what you want the code to do.
It seems that "w" will walk and "shift + w" will sprint, or reverse, right? You then want to have a key to be the toggle. If I'm going way out on left field, please tell me, because I'm lost.
Please elaborate on what you want the code to do.
#2
-
Posted 04 January 2009 - 07:59 AM
As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts.
Add OOP to your scripts via the Class Library. Check out my scripts.
maybe something like
Shift::Send, % "{Shift " ((SToggle := !SToggle) ? "Down" : "Up") "}":?:
#3
-
Posted 04 January 2009 - 08:06 AM
Unless otherwise stated, all code is untested
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
What is it that you want from us? I know, bad start, but let's move past that.
It seems that "w" will walk and "shift + w" will sprint, or reverse, right? You then want to have a key to be the toggle. If I'm going way out on left field, please tell me, because I'm lost.
Please elaborate on what you want the code to do.
What I'd like to do is:
If you hit ctrl, all WASD keystrokes will now be +w, +a, +s, +d, in other words, they will have a shift in front of them. If you hit ctrl again, they will be normal.
#4
-
Posted 08 January 2009 - 04:54 PM
I think this is what you want.
<Shifted> controls whether shift + key is sent or just key. <Shifted> starts off false, so pressing "awsd" will send "awsd". Press control and <shifted> will toggle. Then, pressing "aswd" will send "ASWD".
Hope it does what you want. If not, or if you have any questions, you know where to find me.
<Shifted> controls whether shift + key is sent or just key. <Shifted> starts off false, so pressing "awsd" will send "awsd". Press control and <shifted> will toggle. Then, pressing "aswd" will send "ASWD".
Hope it does what you want. If not, or if you have any questions, you know where to find me.
#SingleInstance Force #NoEnv Shifted := false return ;Toggle <Shifted> Control::Shifted := !Shifted ;Sends wasd $w::Send("w") $a::Send("a") $s::Send("s") $d::Send("d") Send(Key) { ;if <Shifted>, sends +%Key% ;else, sends %Key% global Shifted if Shifted Send, +%Key% else Send, %Key% }
#5
-
Posted 08 January 2009 - 10:47 PM
As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts.
Add OOP to your scripts via the Class Library. Check out my scripts.
Yeah, it doesn't
Basically, if you do it in-game, you can't move at all
The WASD keys no longer work. It's weird because it seems fine outside of the game.
Basically, if you do it in-game, you can't move at all
The WASD keys no longer work. It's weird because it seems fine outside of the game.
#7
-
Posted 07 March 2009 - 03:19 PM
That's because that game must have a block for Send, try SendPlay instead (or another Send mode).
#8
-
Posted 07 March 2009 - 08:25 PM
As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts.
Add OOP to your scripts via the Class Library. Check out my scripts.