Fix Xbox 360 controller support

  Thread Rating:
  • 4 Votes - 4.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
pshchelo Offline
Junior Member
Posts: 1
Joined: Sep 2012
Reputation: 0
Post: #16
I have Xbox 360 wireless controller for PC (official from MS), and the keymap config I've downloaded (v1.9 on pastebin) works for me, but with one huge problem:

when the controller turns off after idling (naturally happens when you watch a movie and do not touch any controls) the whole XBMC quits immediately without any notice!

Using XBMC 11.00 on Win7 64bit, official set of gamepad drivers from MS (v1.2) and the gamepad is recognized by XBMC as "Controller (Xbox 360 Wireless Receiver for Windows)".

Has anyone had such problem? Any ideas how this could be fixed?
(This post was last modified: 2012-09-24 21:20 by pshchelo.)
find quote
darksupernova Offline
Member
Posts: 65
Joined: Sep 2012
Reputation: 0
Post: #17
Works perfectly!

I added the following instead of the gamepad name:

"Xbox 360 Wireless Controller"

The above is how it showed up in my devices windows (windows 7 - all official gear)

However, thank you so much! I tried to add rep but couldnt find the button. Saved me a lot of time and hassle here!!!

Quick Question: I would like to use the sticks for up, down, left, right, however when I try this, they spas out and click 100 times! How do I only let them input once?

EDIT: I tried taking the battery out of the controller and sticking it back in, it still works perfectly... I am using one of the latest overnight builds so that might be why...
(This post was last modified: 2012-10-06 14:58 by darksupernova.)
find quote
wookietv Offline
Member
Posts: 55
Joined: Feb 2009
Reputation: 0
Post: #18
i'm using the live linux installation and tried this... my gamestop 360 joystick came up as "Generic X-Box pad" in the log and i put it into the key mapping file. it worked partially, some commands on the joystick worked, but it seemed to be conflicting with my remote control now and with that i can't go up-down on some screens. i removed it from the usb and had to reboot to get it back.
is there going to be any support for the linux variations?
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 156
Joined: Jul 2012
Reputation: 1
Post: #19
Sorry for the delayed reply everyone. For some reason, the forum wasn't sending me notification emails.

MonkeyRoach: "Everything works pretty good except one problem.When the wireless controller turns off it doesn't work anymore."
pshchelo: "when the controller turns off after idling (naturally happens when you watch a movie and do not touch any controls) the whole XBMC quits immediately without any notice!"
Those are worth filing bug reports on. http://trac.xbmc.org/ There is nothing I can do about that in the keymap.

darksupernova: "I added the following instead of the gamepad name: Xbox 360 Wireless Controller"
I made a new version 1.91 in the original post and added that device name to the list of altname tags. Additionally, v1.91 improves the dpad video time stepping defaults, including back button to go back 7 seconds. Makes the dpad more predictable and consistent. right/left = +/-30 seconds. up/down = +/-10 minutes. back button = -7 seconds.

darksupernova: "I would like to use the sticks for up, down, left, right, however when I try this, they spas out and click 100 times! How do I only let them input once?"
Not possible without some kind of code change. I tried that as well. Just get used to the d-pad.

wookietv: "is there going to be any support for the linux variations?"
The default Linux drivers for the 360 controller use completely different button/axis mappings. Unless a different driver for Linux behaves like the Windows driver (someone let me know if this is the case), it isn't possible to support it with this keymapping.
(This post was last modified: 2012-11-15 21:12 by shiretoko212.)
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 156
Joined: Jul 2012
Reputation: 1
Post: #20
Also, I noticed that the required action for moving around zoomed in images AnalogMove doesn't work properly. It only goes in one direction when I try to add it to the left thumbstick, no matter which combination of limits I use. I also noticed that no one has ever attempted to add this functionality to 360 controllers that I can find. This is probably because people very rarely zoom in and pan around images, so they don't notice the missing functionality. I've left my half working attempt to make it work in 1.91 in the slideshow section. If a dev or anyone else knows how to make it work, please chime in, and I'll update the file.
(This post was last modified: 2012-11-15 20:26 by shiretoko212.)
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 156
Joined: Jul 2012
Reputation: 1
Post: #21
NOTICE v1.92 Major Change: Some of the mappings have been updated to make more sense. The thumbsticks movements/buttons have swapped sticks so that when you click the right thumbstick for the on screen player controls, your left thumb will already be on the dpad ready to navigate them. This is much more natural and easier to use. Previously, you had to click the left thumbstick to get to the player controls, which made the fact that the left thumbstick can't navigate them frustrating. This change solves that.
find quote
da-anda Offline
Team-Kodi Member
Posts: 3,116
Joined: Jun 2009
Reputation: 39
Location: germany
Post: #22
I just managed to get my 360 wireless controller working on my HTPC. I plugged it in order to debug a keymapping issue with the new <FullscreenLiveTV> section in keymaps (which seems to have problems atm).
Doing so, I noticed that the DPad was not working at all on my controller so I checked the logs. Instead of buttons 11-14 my controller is using <hat id="1" position="up/down/left/right"> which is currently missing in the default keymap file. I updated the keymap file accordingly and it's working fine now for me, but before I create a PR and it's been committed to XBMC I wanted to ask you guys if adding those mappings might have any side effects on other controllers / drivers. You can have a look at the updated keymap on my github repository: https://github.com/da-anda/xbmc/commit/f...0ecd8cbd22
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 156
Joined: Jul 2012
Reputation: 1
Post: #23
In my pastebin'd xml keymap in the parent post, you'll see that those hat lines are there and have been since the first iteration, and it works. In this thread, http://forum.xbmc.org/showthread.php?tid=144713 you'll see that someone is already working on a PR to update the default keymap. Sounds like you're working with the newer versions of xbmc though and working with a section that does not exist in our other keymaps. Would it make sense to contribute your change there? I don't know how PRs work.
Actually, looking at the PR again in the thread I linked, I noticed that he doesn't use the d-pad hat functionality that we have in our keymaps. He needs to update the PR with it, among other changes I made. I think it's going to require testing these keymaps on multiple platforms and drivers to determine whether the keymap can be extended to support multiple configurations. I can say for a fact that when I tried to make it work on Linux Mint, I had to fundamentally change the keymap to where it would no longer also function properly on Windows 7. The triggers on Linux Mint with the built in drivers also made the triggers behave wildly even when properly mapped. This might require OS detection to do effectively.
(This post was last modified: 2012-11-19 16:45 by shiretoko212.)
find quote
da-anda Offline
Team-Kodi Member
Posts: 3,116
Joined: Jun 2009
Reputation: 39
Location: germany
Post: #24
yes, I'm working with the keymap for upcoming Frodo release and trying to get this stuff in for Frodo. The PR you mentioned form the other post has already been merged and will be part of the next XBMC release. So if any other changes should be made to the default keymap (like the one on pastebin from you) just tell me which ones are fine by most of you guys actively using the 360 controller and I'll add them to my PR.
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 156
Joined: Jul 2012
Reputation: 1
Post: #25
I just replaced my in use xml file with the contents here: https://github.com/da-anda/xbmc/blob/fb6...roller.xml

First problem right off the bat I noticed is the triggers don't scroll up/down on file lists. Adding this to the global section will fix that: <axis id="3" limit="+1">ScrollUp</axis> <axis id="3" limit="-1">ScrollDown</axis>
Using the left thumbstick to do this only frustrates matters when you discover you can't move down to subsections in the main menu using the thumbstick. Better to use the dpad all the time and use the triggers to scroll naturally.

Likewise adding <axis id="3" limit="+1">CursorLeft</axis> <axis id="3" limit="-1">CursorRight</axis> to VirtualKeyboard improves text entry immensely.


I'll edit this post and add more items as I continue testing.
--

Edit:
The right thumbstick is overloaded. I think it's a bad idea to have volume and seeking on the same thumbstick, because of the risk of accidentally seeking when merely changing volume. This could be bad especially when streaming video. Additionally, having in the global section the following adds a lot of functionality: <button id="9">XBMC.ActivateWindow(ShutdownMenu)</button> <button id="10">XBMC.ActivateWindow(PlayerControls)</button> (these are the thumbstick buttons) In my experience it's good to map something to nearly everything in the global section for enhanced functionality, as the specific sections below that automatically override as necessary, and invalid actions are ignored contextually.

Of course, rather than go point by point, it might be easier if you try my keymap out to compare functionality. Obviously, I'm not the authority on what is the best controller keymap scheme, and I trust your judgement. I'm just trying to share my use-testing that I've been doing for the past few months on this controller. Additionally, I'm not using frodo, which in my past testing with frodo, it treats keymaps differently. You might need to use the stable (possibly on Windows) to experience how my keymap is set up. I come from the early days of Xbox 1, when the whole interface was designed to work with an xbox controller and have been going based on that standard. For example, you can't even pan when zoomed in on an image. AnalogZoom only goes right when mapped. At least in Windows 7 with the built in Microsoft 360 drivers.

Note: To what extent you adopt exactly the changes I made is of no importance to me. My main mission here was to get the altnames into the default keymap for the 360 controller and for the keymap to work out of the box. If the nuances of my keymap are too nonstandard to be fully adopted, I can use my own custom keymap. Either way, thanks to your help, this thread is mostly mission accomplished. I'll continue monitoring this thread to help in any way I can. There's a 10th device name that needs to be added as well. <altname>Xbox 360 Wireless Controller</altname>
(This post was last modified: 2012-11-20 12:29 by shiretoko212.)
find quote
darksupernova Offline
Member
Posts: 65
Joined: Sep 2012
Reputation: 0
Post: #26
(2012-11-19 17:35)da-anda Wrote:  yes, I'm working with the keymap for upcoming Frodo release and trying to get this stuff in for Frodo. The PR you mentioned form the other post has already been merged and will be part of the next XBMC release. So if any other changes should be made to the default keymap (like the one on pastebin from you) just tell me which ones are fine by most of you guys actively using the 360 controller and I'll add them to my PR.

Looking forward to this, make sure you give a shout out here so all the subscribers to this thread can get it!
find quote
da-anda Offline
Team-Kodi Member
Posts: 3,116
Joined: Jun 2009
Reputation: 39
Location: germany
Post: #27
as I'm not used to using the 360 controller to control XBMC and can only test some very basic things (like navigating somewhere, playing a video/song) and actually won't be using the controller in future, is the keymap from shiretoko212 ( http://pastebin.com/X41Z1b1y ) a good addition/change? Especially for the long term 360 controller users?
I'm also not playing much with the controller - so I can't judge myself what might feel like a natural behavior known from either games or the XBOX menus (not having an XBOX, just controller for windows)
(This post was last modified: 2012-11-20 16:35 by da-anda.)
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 156
Joined: Jul 2012
Reputation: 1
Post: #28
Judging from the lack of response from the few others who monitor this thread, what can I do to help address this issue regarding which default keymap behaviors are best beyond what I've already done?
(This post was last modified: 2012-11-23 11:40 by shiretoko212.)
find quote
darksupernova Offline
Member
Posts: 65
Joined: Sep 2012
Reputation: 0
Post: #29
Let me give it a shot now and I'll let you know. I hope its not too different from the one I'm already using!
find quote
shiretoko212 Offline
Team-Kodi Member
Posts: 156
Joined: Jul 2012
Reputation: 1
Post: #30
To anyone testing my keymap in the parent post, make sure to use it in the stable build. I think the current Frodo messes up keymaps from stable right now, correct me if I'm wrong.

Edit: Disregard this post. Current keymap is made for Frodo now.
(This post was last modified: 2012-11-29 09:44 by shiretoko212.)
find quote
Post Reply