Python - Get selected ListItem
#1
Hi All,

I've been searching the forum, but only found some old (2013) posts, saying it is not possible to get a selected listitem-id queried by Python.

I got current songposition by; songpos = xbmc.PlayList(xbmc.PLAYLIST_MUSIC).getposition()

Now I need to get the current selected / focused position of my play-list.
The goal is to autoscroll to currently playing after not pressing any buttons for like 3 seconds.
(I'm developing a 7" car-theme, which does not provide lots of space and therefor requires a lot of scrolling)

Image

I tried something like:

win = xbmcgui.Window(xbmcgui.getCurrentWindowID())
control = win.getControl(50)
(Id of controllist MyMusicSongs.xml)
controlid = control.getSelectedPosition()

which returns:
control; xbmcgui.ControList object at 0x5846eed8
controlid; -1
Reply
#2
Hi All,

I've been searching the forum, but only found some old (2013) posts, saying it is not possible to get a selected listitem-id queried by Python.

I got current songposition by; songpos = xbmc.PlayList(xbmc.PLAYLIST_MUSIC).getposition()

Now I need to get the current selected / focused position of my play-list.
The goal is to autoscroll to currently playing after not pressing any buttons for like 3 seconds.
(I'm developing a 7" car-theme, which does not provide lots of space and therefor requires a lot of scrolling)

Image

I tried something like:

win = xbmcgui.Window(xbmcgui.getCurrentWindowID())
control = win.getControl(50)
(Id of controllist MyMusicSongs.xml)
controlid = control.getSelectedPosition()

which returns:
control; xbmcgui.ControList object at 0x5846eed8
controlid; -1


(Sorry, for posting this on 'addon' thread also.)
Reply
#3
it's supposed to be in the addon dev section.


moving...
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
Python - Get selected ListItem0