right analog stick button control
#1
hi

i looked in the xbmc sources for 3 hours but i don't get it...
in the guiwindow.cpp action_take_screenshot is called to take screenshots using left analog stick button.
in the key.h key_button_left_thumb_stick is here so i thought this one would be called for screenshoot...

so what do i have to use for right analog stick button ?
as i plan to add functions using it, as it's not used yet and those functions have to work in every screen.
thanks for clearing my mind
Reply
#2
the system is as follows:

a button press calls onkey() in application.cpp. we then use the buttontranslator to translate the key pressed identifier (key_button_left_thumb_stick) into an action identifier (action_take_screenshot). we then call onaction() with this action id which then eventually makes it's way into the current window's onaction() routine where we actually do the code based on the action.

the buttontranslator looks in the keymap under the currently active window to figure out which action should be performed. this keymap is initially loaded from keymap.xml.

if you want to do a specific thing when a button is pressed, you first need to write the code necessary for the action, then create a new action_xxx identifier and call your code from the appropriate window when that action id is received. next, add the appropriate entry to keymap.xml associating whichever key you wish to perform the action with that action.

hope that helps Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
hi!
first thank you for the explaination! it's a big help!

so i edited the key.h and defined number 86 for my new action.
then i added it using the same number in the keymap.xml file and defined the markup gamepad as rightthumbbutton.
i added my new function call in the guiwindow.cpp as the takescreenshot() one was here too.
but i checked application.cpp but found not link between the key pressed identifier (key_button_left_thumb_stick)
into an action identifier (action_take_screenshot) here Sad
but anyway, it's working now!

also i noticed a bug in keymapping.txt, it's written take a screenshot is only available in full screen but it's not true as we can take screenshots whenever we want !

another question : is it possible to combine key press? as i haven't noticed this is used in xbmc for now.
Reply

Logout Mark Read Team Forum Stats Members Help
right analog stick button control0