AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Different game, different problem

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Cymbrogi
Guest





PostPosted: Thu Mar 31, 2005 4:45 am    Post subject: Different game, different problem Reply with quote

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





PostPosted: Thu Mar 31, 2005 6:27 am    Post subject: Reply with quote

That subject needs an addition: "No game = no problem"
Sorry couldn't hesitate WinkLaughing´
Why not getting married ?
You'll "playin games" for free LaughingLaughing
Back to top
CarlosTheTackle



Joined: 19 Oct 2004
Posts: 102

PostPosted: Thu Mar 31, 2005 11:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Cymbrogi
Guest





PostPosted: Fri Apr 01, 2005 1:57 am    Post subject: Reply with quote

Bobo: already married - my wife puts up with this, can you believe it? Smile

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. Wink

Cymbrogi
Back to top
Guest






PostPosted: Sun Aug 07, 2005 4:21 pm    Post subject: Reply with quote

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






PostPosted: Sun Aug 07, 2005 5:15 pm    Post subject: Reply with quote

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






PostPosted: Sun Aug 07, 2005 6:26 pm    Post subject: Reply with quote

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 ...

Code:
LShift::

Or with ...

Code:
LShift::
+LShift::

(Where + indicates Shift & LShift together.)

I haven't figured out why the last two don't work.
Back to top
Guest






PostPosted: Sun Aug 07, 2005 6:51 pm    Post subject: Reply with quote

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

PostPosted: Sun Aug 07, 2005 10:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Guest






PostPosted: Tue Aug 09, 2005 10:43 pm    Post subject: Reply with quote

thanks for the help litmus. anyone else want to give it a shot?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group