Kodi Community Forum

Full Version: Input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
I have come across an issue with mapping buttons in Windows.

On all 3 of my PS3-style controller types, the right-analog stick's up(-2) and down(+2) axes work, but the left(-3)/right(+3) axes do not. The rest of the buttons work fine. I checked in the Windows 10 USB Joystick properties and all buttons and axes seem to work fine (apart from the Z Axis (Right Ananlog Up/Down) drifting between 49 and 51%.

I was able to map all controllers perfectly in OpenELEC.

Should I wait for a fix to map properly or just manually add the missing xml tags?
(2016-01-28, 15:54)magnumopus Wrote: [ -> ]I have come across an issue with mapping buttons in Windows.

On all 3 of my PS3-style controller types, the right-analog stick's up(-2) and down(+2) axes work, but the left(-3)/right(+3) axes do not. The rest of the buttons work fine. I checked in the Windows 10 USB Joystick properties and all buttons and axes seem to work fine (apart from the Z Axis (Right Ananlog Up/Down) drifting between 49 and 51%.

I was able to map all controllers perfectly in OpenELEC.

Should I wait for a fix to map properly or just manually add the missing xml tags?

I'm also having troubles mapping axis on windows.
(check http://forum.kodi.tv/showthread.php?tid=255919)
Is the controller using directinput?
Yes they are all using directinput. Sorry I didn't see your post earlier.
(2016-01-29, 00:40)magnumopus Wrote: [ -> ]Yes they are all using directinput. Sorry I didn't see your post earlier.

That's not entirely correct. Xbox 360 controllers use Microsoft's XInput API and not DirectInput. But for any other controller the statement is correct.
(2016-01-28, 09:20)ghallberg Wrote: [ -> ]Are the families supposed to share configuration or only be a grouping for convenience when searching through menues?

Currently I don't think the Wired and Wireless Xbox360 controllers can share a config, since one uses buttons and one uses axes for the d-pad on Linux.

This is changing soonish, but for current kernels and older ones it will be broken.

This is only to share configurations. This is how joysticks in Kodi work. See joystick.Microsoft.Xbox.360.Controller.xml. You define a family, and all joystick names receive the same button configuration.

You can see the raw data we've started collecting in buttonmaps/xml/linux/:

Code:
8Bitdo_NES30_GamePad_Joystick_22b_8a.xml
8Bitdo_SFC30_GamePad_Joystick_22b_8a.xml
DragonRise_Inc._Generic_USB_Joystick_12b_6a.xml
Dual_PSX-USB_Adaptor_Dual_PSX-USB_Adaptor_16b_4a.xml
Gravis_GamePad_Pro_USB_10b_2a.xml
GreenAsia_Inc._USB_Joystick_12b_7a.xml
HuiJia_USB_GamePad_16b_6a.xml
Logitech_Gamepad_F310_11b_8a.xml
Logitech_Logitech_Dual_Action_12b_6a.xml
Logitech_Logitech_RumblePad_2_USB_12b_6a.xml
MY-POWER_CO._LTD._2In1_USB_Joystick_12b_7a.xml
NVIDIA_Corporation_NVIDIA_Controller_v01.03_14b_8a.xml
PLAYSTATION_R_3_Controller.xml
PLAYSTATION_R_3_Controller_17b_29a.xml
Sony_PLAYSTATION_R_3_Controller_19b_27a.xml
Xbox_360_Wireless_Receiver_15b_6a.xml
Xbox_360_Wireless_Receiver_15b_8a.xml
Xbox_360_Wireless_Receiver_XBOX_15b_6a.xml

My guess is that Xbox_360_Wireless_Receiver_15b_6a.xml uses buttons for dpads because it has 6 axes, and Xbox_360_Wireless_Receiver_15b_8a.xml uses axes for d-pads because it has 8 axes.

So yes, several buttons will break. But the majority will work. The point is to use the data we have to give the user the most functionality possible out of the box.
(2016-01-30, 02:51)garbear Wrote: [ -> ]My guess is that Xbox_360_Wireless_Receiver_15b_6a.xml uses buttons for dpads because it has 6 axes, and Xbox_360_Wireless_Receiver_15b_8a.xml uses axes for d-pads because it has 8 axes.

So yes, several buttons will break. But the majority will work. The point is to use the data we have to give the user the most functionality possible out of the box.

Will you still be able to configure each pad individually as well then?
Each unique device, yes. This only concerns the default map when the user hasn't created a button map for that device yet.
HI all

Rather than just winging about it as i have been I'm going to be proactive and see if i can track down why the XBOX 360 wireless DPAD buttons skip teh down and left buttons in OE , now im not starting from zero but I may ask some silly questions so please be paitent

When looking at the buttonmap in \Userdata\addon_data\peripheral.joystick\buttonmap.xml shoudl the values match those in https://github.com/xbmc/xbmc/blob/master...roller.xml ?
In windows they're not the same because we switched from DirectInput to XInput. XInput doesn't use hats IIRC, so the DPAD shouldn't be any different than normal buttons. Very perplexing.

On xpad, the mapping may be the same, but same caveat, hats aren't used so I don't know why the dpad bugs out but the other buttons don't.

I've added a few fixes for input recently, so make sure you're on a build at least as recent as the 27th. For example, buttonmap.xml in addon_data hasn't existed for along time. Button maps are now in separate XML files per device.

You can view all the data we've collected here and soon I'll move it all to https://github.com/kodi-game/resource.buttonmaps.xml
ok so using the Xbox_360_Wireless_Receiver_15b_8a.xml from the link collected data works but not when i produce a local one . Time to dig
@garbear. I am still having the same issue as @flipside101 on the 15b_8a controller after your latest commits. Not had any luck finding the problem yet.

@flipside101, the reason it works out the box with retroplayer is that I manually edited the xml and submitted the buttonmap via github.
(2016-01-31, 10:44)charlie0440 Wrote: [ -> ]@garbear. I am still having the same issue as @flipside101 on the 15b_8a controller after your latest commits. Not had any luck finding the problem yet.

@flipside101, the reason it works out the box with retroplayer is that I manually edited the xml and submitted the buttonmap via github.
@charlie0440 so out of interest where did the edited values come from?
I first ran through the controller wizard and made key maps which had issues with the up/down, left/right which were screwed up with axis not buttons.

I then restarted kodi and pressed up,down,left,right in kodi (not in the controller configuration wizard) and lookee in the log to see which buttons were detected. Took these values and amended the xml to suit.
Ok that was going to be my next port of call , so am i correct in thinking it looks like there is something lost in translation between the system and the wizard in OE ?
Garbear I'll give you as much info as I can in the hope you will find the issue.

(2016-01-30, 02:51)garbear Wrote: [ -> ]My guess is that Xbox_360_Wireless_Receiver_15b_6a.xml uses buttons for dpads because it has 6 axes, and Xbox_360_Wireless_Receiver_15b_8a.xml uses axes for d-pads because it has 8 axes.

So yes, several buttons will break. But the majority will work. The point is to use the data we have to give the user the most functionality possible out of the box.

hmmm, so looking at my submitted (working) keymap for the 8a (the one on github) these are the axis:
Code:
leftstick right axis="+0"
leftstick left axis="-0"
leftstick up axis="-1"
leftstick down axis="+1"
lefttrigger" axis="+2"
rightstick left axis="-3"
rightstick right axis="+3"
rightstick down axis="+4"
rightstick up axis="-4"
righttrigger" axis="+5"

I count that as 6 axes, but my log says:

Code:
AddOnLog: Joystick Support: Initialized joystick 0: "Xbox 360 Wireless Receiver", axes: 8, hats: 0, buttons: 15
Note all 15 buttons are accounted for (0-14) using my keymap, with the d-pad using 4 buttons.

After running the controller config window which skips the down and right selections (full log here) snippet:

Code:
20:25:28 T:139999357400960   DEBUG: Joystick Xbox 360 Wireless Receiver: Button 13 pressed
20:25:28 T:139999357400960   DEBUG: Removing "up" from button map due to conflict
20:25:28 T:139999357400960   DEBUG: Joystick button event handled
20:25:28 T:139999357400960   DEBUG: Joystick Xbox 360 Wireless Receiver: Button 13 released
20:25:29 T:139999357400960   DEBUG: Joystick Xbox 360 Wireless Receiver: Button 12 pressed
20:25:29 T:139999357400960   DEBUG: Removing "right" from button map due to conflict
20:25:29 T:139999357400960   DEBUG: Joystick button event handled
20:25:29 T:139999357400960   DEBUG: Joystick Xbox 360 Wireless Receiver: Button 12 released

doesn't give me anything to help, as up was 13, and right was 12, skipped down and left

but this is the resulting keymap: http://sprunge.us/SVBN snippet:

Code:
<feature name="up" button="13" />
<feature name="down" axis="-7" />
<feature name="right" button="12" />
<feature name="left" axis="+6" />

2 new axes here! are these the missing 7th and 8th axes? or does your code just populate the skipped entrys with some random figures?

What I don't get is how is Up triggering a button 13 press and also a movement on the 7 axis. Are you able to add a commit which could provide more logging info??
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26