Kodi Community Forum

Full Version: Assign 'switch view' to a remote button (XBMC built-in command function)?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

what would I need to add to keymap.xml to map a remote button to the function of 'switch view' (change view from list, small icons, title, etc.. both in Music and Video, both in File and library visualization)?

Thanks in advance,
Ste
You can't currently.
you can do this tho
<f>XBMC.ActivateWindow(musicfiles)</f> and likewise for library view
That's not switching the view mode though obviously!
too bad Sad

but thanks for replying anyway Smile
Note that it is on my TODO list to allow viewmode to be done in alternate ways in the skin (e.g. an "icon toolbar" type look done with buttons instead of a spinner), and this will allow keymapping at the same time.

If someone is interested in looking into it, my idea was 2 builtin functions:

SetViewMode(<id of viewmode>)
NextViewMode()

If you want to try and implement these yourself, you'd need to:

1. Add a method to CGUIMediaWindow to implement those functions (basically you just request m_viewControl to do it's work - see the OnMessage() handler for the view mode click message.)

2. Add the appropriate code to CUtil::ExecBuiltIn() to execute said functions.

In addition to the builtins, a retrieval method (boolean or infolabel) for the current viewmode would be necessary to do the toolbar type approach from the skin.

Cheers,
Jonathan