XBox 360 Controller Mapper [AHK 1.1]

Post gaming related scripts
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: XBox 360 Controller Mapper [AHK 1.1]

21 Jan 2016, 16:42

JemyM - That kind of advanced behaviour would be possible with a custom plugin in UCR.
There is no analog to digital plugin yet for UCR, but it should be a pretty simple job - I may even do it this weekend.
From there, it would be fairly simple to copy that plugin and alter it to do what you want.

Maestrith - It just seems a little pointless to me for both of us to be devoting what limited time we have on overlapping projects - how would you feel about coming on board with HotkeyIt and I on the UCR project? Even if it was just design ideas or helping test, your experience developing these kinds of apps would be welcomed.
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: XBox 360 Controller Mapper [AHK 1.1]

24 Jan 2016, 14:44

I see what you want.
A circle at 85% deflection.
If inside the circle, stick maps to WSAD as normal.
Outside the circle, stick maps to double-tap-and-hold of WSAD
As you transition from one circle to the other, release all input.

This is technically quite easy, but I am not that good at maths.
I can do it for a box, but not a circle. Seeing as XBox pads have a circular range of motion, the diagonals may not behave that well.

I just released UCR 0.0.4 with a Joystick to Button plugin, this will serve a good basis for implementing what you desire - the logic seems fairly simple.

Maestrith - will get back to you soon bud, been real busy.
naddel81
Posts: 1
Joined: 29 Jan 2016, 13:51

Re: XBox 360 Controller Mapper [AHK 1.1]

29 Jan 2016, 13:54

hi,

I tried everything, but I cannot get the FRAPS F10 hotkey to work with my xbox 360 pad.

I want to map a XBOX button to F10 so I dont have to use the keyboard when gaming.

Is that possible? I can only get it to work the other way around (using the keyboard instead of the gamepad).

would be great to get a little hint.

best regards!

EDIT: nevermind, it works now. You cannot do modifications while having started the script. you have to stop it and start it for the changes to take effect.
JemyM

Re: XBox 360 Controller Mapper [AHK 1.1]

30 Jan 2016, 04:12

evilC wrote:I just released UCR 0.0.4 with a Joystick to Button plugin, this will serve a good basis for implementing what you desire - the logic seems fairly simple.
I am very excited about this as it will allow me to control Second Life with a joypad. I can today, but dashing (doubletap) was never possible.
noxx
Posts: 8
Joined: 01 Jan 2017, 12:20

Re: XBox 360 Controller Mapper [AHK 1.1]

01 Jan 2017, 12:35

i have a empty windows
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: XBox 360 Controller Mapper [AHK 1.1]

01 Jan 2017, 13:25

noxx wrote:i have a empty windows
if you are referring to when you add a key yes, I believe I messed up the instructions. When it comes up make sure you have your controller on and press a key or direction and it should add it.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
noxx
Posts: 8
Joined: 01 Jan 2017, 12:20

Re: XBox 360 Controller Mapper [AHK 1.1]

01 Jan 2017, 13:53

i mean this here (screenshot)

Controller is connected

Image
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: XBox 360 Controller Mapper [AHK 1.1]

01 Jan 2017, 13:56

Right, when it says input required, press a button or move one of the sticks on the controller and it should add it to the list.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
noxx
Posts: 8
Joined: 01 Jan 2017, 12:20

Re: XBox 360 Controller Mapper [AHK 1.1]

02 Jan 2017, 02:11

i press a button, but nothing happens

Image
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: XBox 360 Controller Mapper [AHK 1.1]

02 Jan 2017, 04:23

I changed the input window to reflect what is required. https://raw.githubusercontent.com/maest ... r/XBox.ahk
As far as why you are unable to use inputs I can not say. I would suggest updating and giving it another try. If it still does not work, Run this code.

Code: Select all

#SingleInstance,Force
#Persistent
keystroke:={22528:"A",22529:"B",22549:"Back",22545:"Down",22546:"Left",22547:"Right",22544:"Up",22533:"LeftShoulder",22561:"LThumbY_Down",22563:"LThumbX_Left",22550:"LeftThumb",22562:"LThumbX_Right",22560:"LThumbY_Up",22534:"LTrigger",22532:"RightShoulder",22577:"RThumbY_Down",22579:"RThumbX_Left",22551:"RightThumb",22578:"RThumbX_Right",22576:"RThumbY_Up",22535:"RTrigger",22548:"Start",22530:"X",22531:"Y"}
library:=DllCall("LoadLibrary","str","Xinput1_4")
;library:=DllCall("LoadLibrary","str","Xinput1_3") ;If it doesn't work comment this line in and then let me know which one works if any.
VarSetCapacity(State,16)
address:=[]
for a,b in {xGetState:"XInputGetState",xBattery:"XInputGetBatteryInformation",xSetState:"XInputSetState",xkeystroke:"XInputGetKeystroke"}
	address[a]:=DllCall("GetProcAddress","ptr",library,"astr",b)
SetTimer,Update,150
Gui,+hwndMain
Gui,Add,Text,,Press buttons and move the analog sticks.  Numbers should change in the boxes below.
Gui,Add,Text,,Inputs:
Gui,Add,Edit,x+m yp-3 ReadOnly w200
Gui,Show
return
Update:
DllCall(address.xkeystroke,int,0,int,0,"ptr",&state),buttons:=NumGet(state)
if(NumGet(state,4)=1&&buttons){
	ControlSetText,Edit1,% keystroke[buttons],ahk_id%main%
}
return
Escape::
ExitApp
return
GuiClose:
ExitApp
return
There is a line to change if it doesn't work. Just un-comment ;library:=DllCall("LoadLibrary","str","Xinput1_3")

Let me know which, if either, work.

Also run this line

Code: Select all

MsgBox,%A_OSVersion%
and let me know what version is shown.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Guest

Re: XBox 360 Controller Mapper [AHK 1.1]

08 Jan 2017, 22:10

maestrith wrote:I changed the input window to reflect what is required. https://raw.githubusercontent.com/maest ... r/XBox.ahk
As far as why you are unable to use inputs I can not say. I would suggest updating and giving it another try. If it still does not work, Run this code.
I'm having the same issue, and I think it is related to line 244.

Code: Select all

VarSetCapacity(state,4)
This is 16 in the test script.

Regards,
G
Gargemal
Posts: 1
Joined: 08 Jan 2017, 22:05

Re: XBox 360 Controller Mapper [AHK 1.1]

09 Jan 2017, 06:20

maestrith wrote:I created 3 basic profiles. They are not complete, but they are a pretty good start.
Guild Wars 2
Factorio
and Rimworld
Download them and then File/Import them into your script.
Masestrith,

Can you add these files to github? I'm having problems getting Guild Wars 2 to respond.

Thanks,
G
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: XBox 360 Controller Mapper [AHK 1.1]

09 Jan 2017, 11:15

Gargemal wrote:
maestrith wrote:I created 3 basic profiles. They are not complete, but they are a pretty good start.
Guild Wars 2
Factorio
and Rimworld
Download them and then File/Import them into your script.
Masestrith,

Can you add these files to github? I'm having problems getting Guild Wars 2 to respond.

Thanks,
G
Sorry about that. I uploaded them to Github
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: XBox 360 Controller Mapper [AHK 1.1]

09 Jan 2017, 11:24

Ok, I figured out what's up. I program in x32 not x64. I added in a bit of code to change it from x64 to x32 and it "should" be fine.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 22 guests