Kodi Community Forum

Full Version: List container, static Items and <onfocus> possible?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way or workaround to do something like this? I have a list container and I want to use a builtin function when I focus a specific static item. For example, something like this would be nice to have:
 
Code:
<control type="list">
   ...
   <item>
      <label>Item 1</label>
      <onclick>dostuff</onclick>
      <onfocus>dostuff</onfocus> <!-- THIS WOULD BE NICE TO HAVE -->
   </item>
</control>

I know that I could do it with a grouplist, buttons and <onfocus> but in this case I have to do it in a list container ...

Any suggestions? Thanks!
You can add a invisible button in the <focusedlayout> part of the container.
<control type="grouplist">
   ...

<control type="button">

      <label>Item 1</label>
      <onclick condition="1"=>dostuff 1</onclick>
      <onfocus condition="a">dostuff a</onfocus> <!-- e.g i did it to run a cript -->
      <font>***</font>
      <visible>true</visible>
      <top>145</top>
      <left></left>
      <width>122</width>
      <height>40</height>
      <align>center</align>
      <textoffsetx>0</textoffsetx>
       <scroll>true</scroll>
       <scrollspeed>20</scrollspeed>
</control>
mardukL Wrote:
Code:
<control type="grouplist">
...
Thanks for your suggestion but as I said I have to do it in a list container not a grouplist with buttons. Thanks anyway!
 
(2018-09-27, 06:33)sualfred Wrote: [ -> ]You can add a invisible button in the <focusedlayout> part of the container.
 That's brilliant, why didn't I think of that ... Thank you!