Having troubles with onAction and another question:
#1
Question 
Hi, I've recently taken a shot at the XBMC Python scripting stuff, and so far I've been really impressed with the ease and power behind the function -- I have however, run into a few problems with the onAction() function. I can't seem to make it prevent the default XBMC action mapped to that key from happening (like the thumbsticks moving the song forward and changing the volume and the X button switching to the visualization while music is playing), I've been digging around the site and the forums for a while now trying to find a way to make my script only perform the actions defined for those keys and nothing else -- but I can't find anything indicating this has been an issue for anyone else.

I'd rather not have to edit the key mapping stuff because I intend to release this to other people, and I don't want them to have to edit their XML files to make full use of the system.

Now on to my second question; I have a USB keyboard connected to my Xbox and it works great, but I'm not quite sure how to add support for it to my program without requiring the virtual keyboard being open; I know onAction() registers keystrokes in the 65,000 range but I'd prefer not having to define an action for every key on the keyboard just for basic hardware keyboard support. Is there a more simple way of having it translate a key press into an actual key character? (I also have the same issue with the keyboard as I do above, the S key tries to shut the system down and things of that nature).

Any help would be greatly appreciated, thanks.
Reply
#2
Smile 
I finally managed to fix this issue myself, and I figured I'd post the solution here for anyone else who runs across this problem.

If you change the class of your main window from an xbmcgui.Window to an xbmcgui.WindowDialog it'll allow you to properly capture and use the buttons/keys as long as you have something defined for that key without executing the parent XBMC function for said key.

I am still curious about my other question though, if anyone could point me in the right direction of adding better hardware keyboard support to my script I'd appreciate it.

Thanks a bunch, keep up the good work, XBMC developers and fellow scripters!
Reply
#3
Got it all figured out, thanks anyways -- just took a little math to get the basic keyboard support in.
Reply

Logout Mark Read Team Forum Stats Members Help
Having troubles with onAction and another question:0