Some questions about controller keymaps
#1
I have some questions for garbear or anyone else who might know:

With the new controller stuff for v17, does longpress still work for game controllers/joysticks? IIRC, it did in v16, but I haven't been following closely with the controller work for v17.

Second, I've really tried to look, but I'm not sure where to find the new default keymaps for controllers. That is, the defaults for what "A" and "back" and etc does. I'm assuming that's now in the other github repo for the joystick add-on?

Depending on the answer to the first question, there was a request to make a home button for the system-wide buttons such as "back". I was thinking long-press on "Back" would be good for home, as we do that for keyboards and remotes (that look like keyboards to the OS). Assuming that's still an xml file, I would gladly PR this myself, but I don't know where to make that PR :)
Reply
#2
Longpress isn't implemented yet. How do you think the keymap should look? my thought is:

Code:
<keymap>
  <global>
    <joystick>
      <back>Back</back>
      <back holdtime="500">ActivateWindow(Home)</back>
    </joystick>
  </global>
</keymap>

Have you seen joystick.xml?
Reply
#3
And what will be the use of normal back? Without holding?

I dont see the point of having two back (b and back), just use the back button to go to homescreen like they use to be.

unless back is needed for something else that Im not aware.
Reply
#4
Yeah, something like that.
Reply
#5
(2016-08-10, 05:59)trihy Wrote: And what will be the use of normal back? Without holding?

I dont see the point of having two back (b and back), just use the back button to go to homescreen like they use to be.

unless back is needed for something else that Im not aware.

B might not always be "back". Such as for retroplayer.
Reply
#6
How about this?

Code:
<keymap>
  <global>
    <joystick>
      <b>Back</b>
      <back holdtime="500">ActivateWindow(Home)</back>
    </joystick>
  </global>
</keymap>
Reply
#7
(2016-08-10, 04:30)garbear Wrote: Longpress isn't implemented yet. How do you think the keymap should look? my thought is:

Note that, as buttons are treated as keys on Android, I'm pretty sure longpress worked when i tried Krypton on shield...
Reply
#8
PR8807 added joystick support on android. are you sure buttons are still treated as keys? what about analog sticks/triggers?
Reply
#9
(2016-08-12, 08:05)garbear Wrote: PR8807 added joystick support on android. are you sure buttons are still treated as keys? what about analog sticks/triggers?

No Wink
I just assume it is still the case as longpress works.

It's actually the only way to bring the context menu with a gamepad, afaict...
<X> does back, not contextmenu, as is <B>. <Y> does pause
Bumpers do PgUp/PgDown but triggers do nothing

All in all, pretty weird, I must say...
What map is supposed to be used for joysticks, those days? What I'm seeing does not seem to fit joystick.xml

OTOH, there is now, e.g. <x> for a button in joystick.xml and <x> for a key in keyboard.xml. Possible clash?
Reply
#10
(2016-08-12, 09:40)Koying Wrote: OTOH, there is now, e.g. <x> for a button in joystick.xml and <x> for a key in keyboard.xml. Possible clash?

Nope, keyboard <x> is translated here, joystick <x> is translated here.

(2016-08-12, 09:40)Koying Wrote: What map is supposed to be used for joysticks, those days? What I'm seeing does not seem to fit joystick.xml

Joystick use two maps now. First, the raw driver commands are translated to 360 controller buttons (using these button maps), then those are translated to Kodi actions using joystick.xml.

(2016-08-12, 09:40)Koying Wrote:
(2016-08-12, 08:05)garbear Wrote: PR8807 added joystick support on android. are you sure buttons are still treated as keys? what about analog sticks/triggers?

No Wink
I just assume it is still the case as longpress works.

It's actually the only way to bring the context menu with a gamepad, afaict...
<X> does back, not contextmenu, as is <B>. <Y> does pause
Bumpers do PgUp/PgDown but triggers do nothing

All in all, pretty weird, I must say...

Previously, the driver commands and Kodi actions were spread out among lots of joystick files. Now, all controllers are translated to the 360 controller and the 360 controller is looked up in joystick.xml.

The entire point of PR8807 was to move the driver data out of the joystick.xml files and into an add-on. Thus peripheral.joystick was born, and joystick.xml became much simplified.

joystick.xml has keys for xbox 360 buttons because this is our "default" controller. The choice is arbitrary, we could have used <circle> <cross> <square> <triangle> as keys but the 360 controller seemed more standard.

I hope this explains the new system.
Reply
#11
Interestingly, if <a> is ignored, the Shield gamepad resends the button event as <dpad_center> Wink
That explains why longpress works on it...

OTOH that cannot be right...
Code:
20:31:12 T:1397561648   DEBUG: Keyboard: scancode: 0x17, sym: 0x000d, unicode: 0x0000, modifier: 0x0
20:31:14 T:1396496688 WARNING: CPeripheralBusAndroid: ignoring input event for unknown input device with ID 6
20:31:14 T:1397561648   DEBUG: Keyboard: scancode: 0x66, sym: 0x0119, unicode: 0x0000, modifier: 0x0
20:31:14 T:1397561648   DEBUG: bool CInputManager::OnKey(const CKey&): pagedown (0xf085) pressed, action is PageDown
20:31:14 T:1396496688 WARNING: CPeripheralBusAndroid: ignoring input event for unknown input device with ID 6
20:31:14 T:1397561648   DEBUG: Keyboard: scancode: 0x66, sym: 0x0119, unicode: 0x0000, modifier: 0x0
20:31:15 T:1396496688 WARNING: CPeripheralBusAndroid: ignoring input event for unknown input device with ID 6
20:31:15 T:1397561648   DEBUG: Keyboard: scancode: 0x67, sym: 0x0118, unicode: 0x0000, modifier: 0x0
20:31:15 T:1397561648   DEBUG: bool CInputManager::OnKey(const CKey&): pageup (0xf084) pressed, action is PageUp
20:31:15 T:1396496688 WARNING: CPeripheralBusAndroid: ignoring input event for unknown input device with ID 6
20:31:15 T:1397561648   DEBUG: Keyboard: scancode: 0x67, sym: 0x0118, unicode: 0x0000, modifier: 0x0
Reply
#12
Hm. Any idea why the android bus doesn't know about "ID 6"?
Reply
#13
Maybe an enumeration issue?

Unfortunately, kodi wouldn't start anymore now that I enabled debug Wink

P.S. If that helps, I see:
Code:
android_1997_2433.xml
android_FFFF_0000.xml

in peripheral_data.
Reply
#14
(2016-08-12, 20:57)Koying Wrote: P.S. If that helps, I see:
Code:
android_1997_2433.xml
android_FFFF_0000.xml

in peripheral_data.

the "android" there is the android peripheral bus, and it looks like it discovered the joystick. Not sure what 0xFFFF, 0x0000 is.

I think a fix for this was added in ae41f30 (from PR8385 ). The fix requires building with libudev. If this is absent, the fix will be #ifdef'ed out.
Reply

Logout Mark Read Team Forum Stats Members Help
Some questions about controller keymaps0