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 

Racing game using mouse opposed to arrow keys

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



Joined: 27 Jun 2006
Posts: 182

PostPosted: Mon Apr 21, 2008 12:23 pm    Post subject: Racing game using mouse opposed to arrow keys Reply with quote

Hello. There's something wrong with my keyboard or motherboard which makes it lag in games. I've ordered a new usb keyboard to try and fix it, but in the mean time i want to try something.

I want to use my mouse to play a racing game. drag the mouse left to turn left, and drag right to turn right, lbutton as up and rbutton as down. But i'm not finding it that easy. This is what i have. It 'kinda' works but if you drag the mouse too far right, for example, you can't turn right any more. If i mousemove to center, it'd turn left.

Code:

settimer, turn, 100

^k::exitapp

;lbutton::send, {up}
;rbutton::send, {down}

turn:

mousegetpos, x_ax_in

if(x_ax_in = x_ax){
send, {left up}
send, {right up}
}

if(x_ax_in > x_ax){
send, {left up}
send, {right down}
mousegetpos, x_ax
x_ax_in =
} else {
if (x_ax_in < x_ax){
send, {right up}
send, {left down}
mousegetpos, x_ax
x_ax_in =
}
}

return

_________________
Back to top
View user's profile Send private message
Clash



Joined: 27 Jun 2006
Posts: 182

PostPosted: Tue Apr 22, 2008 12:44 am    Post subject: Reply with quote

Surely someone's tried a similar script?
_________________
Back to top
View user's profile Send private message
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