| View previous topic :: View next topic |
| Author |
Message |
Cymbrogi Guest
|
Posted: Thu Mar 31, 2005 4:45 am Post subject: Different game, different problem |
|
|
Thanks to Hester for helping me with my Joint Ops script, now I'm on to Battlefield Vietnam.
Simple (or I think its simple) question: Why won't this script let me hit left shift once, but act like I am holding it down, until I hit left shift a 2nd time? I want it to act like I hold down left shift the whole time, but it starts with 1 keypress and terminates with the 2nd keypress.
| Code: |
*LShift::
; Standing, so crouch when hit LShift
if imchatting=false
{
Send, {ShiftDown}
KeyWait,LShift
Send, {ShiftUp}
return
}
return
|
I played with a Loop also, but that didn't seem to work (not that I necessarily had it coded right anyway).
Thanks (as always) for any suggestions. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Thu Mar 31, 2005 6:27 am Post subject: |
|
|
That subject needs an addition: "No game = no problem"
Sorry couldn't hesitate  ´
Why not getting married ?
You'll "playin games" for free   |
|
| Back to top |
|
 |
CarlosTheTackle
Joined: 19 Oct 2004 Posts: 102
|
Posted: Thu Mar 31, 2005 11:10 am Post subject: |
|
|
Perhaps something like this might work:
| Code: |
*LShift::
; Standing, so crouch when hit LShift
if imchatting=false
{
GetKeyState, shift_state, LShift
If shift_state = U
Send, {ShiftDown}
If shift_state = D
Send, {ShiftUp}
}
return |
Untested, of course.
C |
|
| Back to top |
|
 |
Cymbrogi Guest
|
Posted: Fri Apr 01, 2005 1:57 am Post subject: |
|
|
Bobo: already married - my wife puts up with this, can you believe it?
Carlos:
Interesting thought, problem is that with that the Shift never lets go. For the time being I'm just going to live with it. Too many other things to worry about.
Thanks for all the input - I once had some concept of BASIC but that was long ago and my mind isn't as sharp as it once was.
Cymbrogi |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Aug 07, 2005 4:21 pm Post subject: |
|
|
| Looks like this post got abandoned a long time ago so I am resurrecting it because it looks like the closest match to my problem. Could someone give a hand with this? I have a couple of games that I would like to be able to use shift as a toggle so I do not have to hold it down to crouch. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Aug 07, 2005 5:15 pm Post subject: |
|
|
ok, so i can get it to work using the n key but not with right shift. here is my code for using the n key:
*n::
if GetKeyState("n") ; n is down, so release it.
Send {n up}
else
Send {n down}
return
I can also use this code to use right shift as a modifer for the n key. basically in the game i have n set to crouch and right shift is the key i use to do the crouching.
*RShift::
if GetKeyState("n") ; n is down, so release it.
Send {n up}
else
Send {n down}
return
so what is that i am missing? |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Aug 07, 2005 6:26 pm Post subject: |
|
|
This works -- at least in Notepad.
| Code: | Shift::
GetKeyState, ShiftKeyState, Shift, T
If ShiftKeyState = U
Send, {ShiftDown}
Else
Send, {ShiftUp}
Return |
But this script will not work properly if you start it with ...
Or with ...
(Where + indicates Shift & LShift together.)
I haven't figured out why the last two don't work. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Aug 07, 2005 6:51 pm Post subject: |
|
|
| the first code example works for left shift but not right....weird. how to get right shift? |
|
| Back to top |
|
 |
Litmus Red
Joined: 25 Jul 2005 Posts: 139 Location: Richmond, Virginia
|
Posted: Sun Aug 07, 2005 10:52 pm Post subject: |
|
|
| That last script was mine. Yeah, I didn't try the right shift button before posting, and it doesn't work for me either. I'm clueless. |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Aug 09, 2005 10:43 pm Post subject: |
|
|
| thanks for the help litmus. anyone else want to give it a shot? |
|
| Back to top |
|
 |
|