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 

For PC games (via USB)

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Mapping for XBox gamepad
Guest





PostPosted: Wed Aug 18, 2004 9:22 am    Post subject: For PC games (via USB) Reply with quote

I want to begin a thread on this, I will program it myself if I have to but I have no idea where to start so may take months or years. Here is all the information I can muster. This controller does work perfectly in Halo PC and pretty good with games that let you map controllers. What I want is to map the left controller to adsw and the right to mouse look, right trigger to mouse1 and left trigger to mouse 2 (for starters). What I really want is a good template so people can easily open the file and change whatever they want to fit the game they are playing. This is what I have to start with:

x + y are joystick one
9 is push in on joy 1
u + v are joystick 2 (U up and down, v left and right)
10 is push in on joy 2
z is left trigger
r is right trigger
pov is dpad
8 is select
7 is start
1 is a
2 is b
3 is x
4 is y
5 is black
6 is white
-------------------------------------------------
Right controller
u all the way up = 000, down = 100
v left = 000, right = 100
(This is what I want to map to mouse look)
-------------------------------------------------
pov (D pad, in compass directions. Numbers start with "pov" like pov0 etc)
n = 0
s = 18000
w = 27000
e = 9000

nw = 31500
ne = 4500
sw = 22500
se = 13500
--------------------------------------------------
Without touching anything, this is what it shows on the joystick test (sometimes different after moving then releasing but I've never had problems with the joysticks just detection of the right one):
Microsoft PC-joystick driver:
x053 y049 z000 r000 u042 v053 pov-1

Even though it says zero, I have had the right joystick mysteriously be constantly on (and pushing it counteracts it, so I don't understand at all). Maybe it's something else but even when I tried the Nyko Dual Analog patch and the mouse look it took off into a corner. Nothing out of the ordinary showed on the joystick test (see above). Some games fix this some don't. I want to have the ability to shut it off or map it to something that wont hurt anything. In Halo PC, there are no problems, so I know it is possible to get everything to work 100%. I think maybe the trigger is being mistaken for the right joystick (which would explain why the right joy rarely works in games). If I knew how to correct this I would but I look at these scripts and can't tell what to change to modify it. I think the existing joystick scripts are probably what I want to use since they are already tested. I just need to change a few things, and need alot of help.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Wed Aug 18, 2004 12:28 pm    Post subject: Reply with quote

I should note first of all that you cannot simulate joystick buttom presses or movement with AutoHotkey. So you will be limited to mapping joysticks buttons and axis positions to mouse behavior or keystrokes. In other words, if there is no way in a game to disable a specific joystick or joystick axis, there might be no way to stop the misbehavior in that particular game.

If you haven't already, you might look at the Use Joystick As Mouse script. That and the Joystick Test script contain nearly all of my knowledge about scripting joystick hotkeys and custom behaviors. There are also a few forum topics about joysticks that might help:
http://www.autohotkey.com/forum/viewtopic.php?t=469
http://www.autohotkey.com/forum/viewtopic.php?t=390
http://www.autohotkey.com/forum/viewtopic.php?t=391

It's interesting that the XBox gamepad appears to use parts of two different logical joysticks. You might try enhancing the joystick test script to watch two joysticks simultaneously to help you analyze what's going on. You can also try calibrating the joystick with the control panel applet (or other software) if you haven't already.
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Wed Aug 18, 2004 3:16 pm    Post subject: Reply with quote

I also have another driver (maybe the one I should have) that defines things a little different. It makes the left and right triggers into buttons 11 and 12 and the right joystick uses r and v. This driver helps a lot but I still want to be able to map r and v for mouse look. Now I will see what I can learn from the other articles. Thanks.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions 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