Kodi Community Forum
Question about actionID,buttonid and thumb sticks - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Question about actionID,buttonid and thumb sticks (/showthread.php?tid=31519)



Question about actionID,buttonid and thumb sticks - BigBellyBilly - 2008-02-27

Can anyone clear up a few points for me;

When using WindowXML or DialogXML and their onAction()

1) against the param 'action', should I be trapping action.getId() or just acting purely upon action.getButtonCode() ?

I ask as the thumb sticks don't seem consotent in their actionID reporting.

eg
left stick gives no actionID (0) AND a buttonCode in (280, 281, 282, 283)

for right thumb stick, actionID in (88, 89, 124, 125) AND a buttonCode in (266, 267, 268, 269)

so, why no actionID for left thumb stick ?

2) When onAction() traps a buttonCode for right thumb stick UP or DOWN and does <my own action> it still causes the volume control to be displayed.
How can I prevent the volume control from receiving an action?
Can it be disabled via a skin builtin ?

3) If you use a thumbstick it calls onAction repeatedly, I have to set a 'ready' flag to ignore following unwanted onAction calls, setting 'ready' ok when processing of the first onAction() is complete.
Is this the correct behaviour ?

These question have come about as I'm updating more of my scripts on be XML based.

Anyone help ?
BBB


- Nuka1195 - 2008-02-27

1. I wouldn't use buttoncode unless you need thumbsticks or triggers, just use action. i learned that i did not have all codes for controllers available to linux. so i switched back to just the action. no need for getId()

2. there was a patch to prevent that i thought, but it may have been taken out. i don't see anything in the manual, so it is expected behavior. Smile

3. look at "Ambient Light Control Pad" in scripting svn on how to use thumbsticks.


- BigBellyBilly - 2008-02-27

yeah. buttonCode just for thumb sticks, seems most reliable and it does seem to be working if i use my own 'ready' flag. bit of a bodge thou.

I looked at your ALCP but you just use left thumbstick.
It is just the up/down on right thumb stick thats giving me the unwanted volume control animation. I'll just have to not use it.

cheers


- Nuka1195 - 2008-02-27

that's what i did, just not use it. Volume is globally mapped.

i'm almost positive there was a patch by asteron to do what you want, but it must have been removed.