Main forum > GLBasic - en

Updating GameInput API (previous wanted to check Switch)

(1/5) > >>

spacefractal:
Those who have Swicth Pro controller. Can you checking which buttons that does that.

Etc im need the name of it, and how and which axis the right controller and the both analoge triggers does.

Im purchased such of one you can see, but that controller did not have the analoge trigger, but a digital trigger instead (not a issue in such a game that is not racing really). Im wasent aware of that of course, but im implementated this feature of course.

Im do believe they follow the ps layout button wise, not xbox. Then im will update my GameInput thing for Windows.

bigsofty:
I have some 8Bitdo Pro 2 Wired USB Controllers for Switch, these results any use?

spacefractal:
Just give me the screen like the above one.

Anyway im think found a method im can detect, its using a xbox or a ps4/switch laylout....


--- Code: (glbasic) ---self.code$[i]="standard"
IF RIGHT$(self.NAMES$[i],1)="s" OR INSTR(self.NAMES$[i],"switch")>-1 OR INSTR(self.NAMES$[i],"pro controller")>-1
self.code$[i]="switch"
self.digi[i]=-1
ENDIF

IF INSTR(self.NAMES$[i],"ps4")>-1 OR INSTR(self.NAMES$[i],"ps3")>-1
self.code$[i]="ps4"
ENDIF

IF INSTR(self.NAMES$[i],"xbox")>-1 OR INSTR(self.NAMES$[i],"360")>-1
self.code$[i]="xbox"
ENDIF

IF self.code$[i]="standard"
LOCAL result=GETJOYBUTTON(i-1, 6)+(GETJOYRX(i-1)+1)/2
IF result<0.4 OR result>0.6 THEN self.code$[i]="ps4/switch"
ENDIF

--- End code ---

GETJOYBUTTON(i-1, 6)+(GETJOYRX(i-1)+1)/2 gave 0.5 on a xbox controller and 0.0 on a ps4 controller or if its dont have such a left trigger.

bigsofty:
Out of house till tomorrow night but maybe this database of controller mappings may help?

https://github.com/gabomdq/SDL_GameControllerDB

spacefractal:
This is a good database. The only issue is im in this case need to find out how to get the GUID code of that controller. When its possible, im could actuelly implement that one in the GameInput API instead that one im using (only contains official xbox, ps4 and switch controllers).

Navigation

[0] Message Index

[#] Next page

Go to full version