Kodi Community Forum

Full Version: Show info of focused item first (instead of entering right away)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am aware that there is a built-in option for this, but it applies to all videos, and the skin I'm working on only considers this for movies. So I want Enter to open a TV episode right away, but for Enter to show info on movies. From this thread, I disabled the option to show info and then added this to the movie view:

xml:
                <control type="grouplist">
                    <control type="button" id="9999">
                    <onclick>Action(info)</onclick>
                    </control>
                </control>

It doesn't work though. I'm not sure where to place it, nor understand the id="" stuff so it might be that. What I do know is that my DialogVideoInfo.xml has a hidden button that opens the movie with:

xml:
                <control type="grouplist">
                    <control type="button" id="97">
                        <onclick>SendClick(8)</onclick>
                        <onup>Back</onup>
                        <ondown>Back</ondown>
                        <onleft>Back</onleft>
                        <onright>Back</onright>
                    </control>
                </control>

This is the entire view:

xml:
<?xml version="1.0" encoding="UTF-8"?>
<includes>
    <include name="Viewtype_50_List">
        <control type="group">
            <visible>Control.IsVisible(50)</visible>
                <control type="multiimage">
                    <fadetime>320</fadetime>
                    <imagepath>general/background.png</imagepath>
                    <aspectratio>stretch</aspectratio>
                </control>
                <control type="grouplist">
                    <control type="button" id="99">
                    <onclick>Action(info)</onclick>
                    </control>
                </control>
                <control type="fixedlist" id="50">
                    <width>1920</width>
                    <height>1080</height>
                    <onup>50</onup>
                    <ondown>50</ondown>
                    <focusposition>3</focusposition>
                    <orientation>vertical</orientation>
                    <itemlayout height="160" width="1920">
                        <control type="image">
                            <aligny>center</aligny>
                            <left>100</left>
                            <width>80</width>
                            <aspectratio>keep</aspectratio>
                            <texture background="true">$INFO[ListItem.Icon]</texture>
                            <colordiffuse>80EEEEEE</colordiffuse>
                        </control>
                        <control type="label">
                            <aligny>center</aligny>
                            <left>225</left>
                            <width>600</width>
                            <height>150</height>
                            <font>Reg30</font>
                            <textcolor>80CFCFCF</textcolor>
                            <label>$INFO[ListItem.OriginalTitle]</label>
                        </control>
                        <control type="image">
                            <top>75</top>
                            <align>center</align>
                            <height>25</height>
                            <aspectratio>keep</aspectratio>
                            <texture background="true">rating/none.png</texture>
                        </control>
                        <control type="image">
                            <top>75</top>
                            <align>center</align>
                            <height>25</height>
                            <aspectratio>keep</aspectratio>
                            <texture background="true">$INFO[ListItem.UserRating,rating/,.png]</texture>
                            <colordiffuse>80EEEEEE</colordiffuse>
                        </control>
                        <control type="label">
                            <aligny>center</aligny>
                            <left>1100</left>
                            <width>600</width>
                            <height>150</height>
                            <font>Light30</font>
                            <textcolor>80CFCFCF</textcolor>
                            <label>$INFO[ListItem.Director]</label>
                        </control>
                        <control type="label">
                            <top>60</top>
                            <left>1650</left>
                            <width>250</width>
                            <height>150</height>
                            <font>Light30</font>
                            <textcolor>80CFCFCF</textcolor>
                            <label>$INFO[ListItem.Year]</label>
                        </control>
                        <control type="image">
                            <bottom>0</bottom>
                            <left>100</left>
                            <width>88%</width>
                            <height>2</height>
                            <aspectratio>stretch</aspectratio>
                            <texture background="true">general/separator.png</texture>
                        </control>
                    </itemlayout>

                    <focusedlayout height="180" width="1920">
                        <control type="group">
                            <animation effect="zoom" time="120" start="100" end="105" center="auto" tween="Back" easing="Out">Focus</animation>
                            <control type="image">
                                <top>-100</top>
                                <width>1950</width>
                                <height>380</height>
                                <aspectratio>scale</aspectratio>
                                <texture background="true">general/focus_item.png</texture>
                            </control>
                            <control type="image">
                                <aligny>center</aligny>
                                <left>100</left>
                                <width>100</width>
                                <aspectratio>keep</aspectratio>
                                <texture background="true">$INFO[ListItem.Icon]</texture>
                            </control>
                            <control type="fadelabel">
                                <aligny>center</aligny>
                                <left>250</left>
                                <width>580</width>
                                <font>Bold42</font>
                                <textcolor>FFFFFFFF</textcolor>
                                <label>$INFO[ListItem.OriginalTitle]</label>
                                <textwidth>580</textwidth>
                                <scroll>false</scroll>
                            </control>
                            <control type="image">
                                <top>75</top>
                                <align>center</align>
                                <height>30</height>
                                <aspectratio>keep</aspectratio>
                                <texture background="true">rating/none.png</texture>
                            </control>
                            <control type="image">
                                <top>75</top>
                                <align>center</align>
                                <height>30</height>
                                <aspectratio>keep</aspectratio>
                                <texture background="true">$INFO[ListItem.UserRating,rating/,.png]</texture>
                            </control>
                            <control type="label">
                                <aligny>center</aligny>
                                <left>1100</left>
                                <width>600</width>
                                <font>Light42</font>
                                <textcolor>FFFFFFFF</textcolor>
                                <label>$INFO[ListItem.Director]</label>
                                <textwidth>480</textwidth>
                            </control>
                            <control type="label">
                                <aligny>center</aligny>
                                <left>1600</left>
                                <font>Light42</font>
                                <textcolor>FFFFFFFF</textcolor>
                                <label>$INFO[ListItem.Year]</label>
                            </control>
                        </control>
                    </focusedlayout>
                </control>
        </control>
    </include>
</includes>
You can't control what Enter does.
Hmm... so do you think there's any solution to this? I mean I'm "just" trying to place an invisible button that shows info for the focused item. Is that not doable?
The button would need to be clicked/focused to actually do anything.
Meaning it's not possible to have both the focus on the button at all times and be able to scroll the list of movies? If so, do you know if there's any way I could possibly handle this even if it is outside of the skin? I feel like I'm pretty close to a solution via keymaps. Since they can be modified on a per-window basis, I thought I'd be able to set up one action for each view:

xml:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
  <global>
    <keyboard>
      <return>Select</return>
      <enter>Select</enter>
    </keyboard>
  </global>
  <window10025>
    <keyboard>
      <return>Info</return>
      <enter>Info</enter>
    </keyboard>
  </window10025>
</keymap>

window10025 being the videos/MyVideoNav.xml window (so it affects TV Shows and Movie views alike). Is there any way I can set up one ID like this for a (TV Shows) viewtype?
Not possible.

I guess you could focus on a hidden button using onload, then use that to move the list and conditionally open info for a movie or just select a TV show. You'd lose all context menu control though.
Oh my god, that would totally work! I really thought there was no way. But goddamn I cannot get it working. I'm almost entirely unfamiliar (or unsuccessful) with buttons and ids (how do you even keep track of them among all files?) so I'm at a weak spot.

I'm trying to model this after the DialogVideoInfo.xml button, which is focused as soon as the Info windows pops up, and does the things I tell it to do. The way it's framed is:

xml:
<?xml version="1.0" encoding="UTF-8"?>
<window>
    <defaultcontrol always="true">97</defaultcontrol>
    <controls>
            <control type="group">
                [Movie info stuff here]
                <control type="button" id="97">
                    <onclick>SendClick(8)</onclick>
                    <onup>noop</onup>
                    <ondown>noop</ondown>
                    <onleft>noop</onleft>
                    <onright>noop</onright>
                </control>
            </control>
    </controls>
</window>

But the many ways I've tried to integrate the <window> and <defaultcontrol> tags on the viewtype end either on the view getting "corrupted" (can't move it, posters don't appear - this is when I tried adding <window> at the top, which I thing conflicted with the <includes>), or it disregarding any focus on the button, which is where I'm at now. I feel like this is the closest I've gotten, setting up a button that shows up, isn't focused, and has only "Back" as function (so that if I somehow stumble into focusing it, I'll quickly realize so as it'd trigger the "Back" function):

 
xml:
<?xml version="1.0" encoding="UTF-8"?>
<includes>
    <include name="Viewtype_50_Movie_List">
            <control type="group">
                <visible>Control.IsVisible(50)</visible>
                    <control type="multiimage">
                        <fadetime>320</fadetime>
                        <imagepath>general/background.png</imagepath>
                        <aspectratio>stretch</aspectratio>
                    </control>
                    <control type="button" id="98">
                          <label>TEST BUTTON FOR MOVEMENT</label>
                          <font>Reg30</font>
                          <textcolor>FFFFFFFF</textcolor>
                          <onclick>Back</onclick>
                          <onfocus>Back</onfocus>
                          <onunfocus>Back</onunfocus>
                          <onup>Back</onup>
                          <ondown>Back</ondown>
                          <onleft>Back</onleft>
                          <onright>Back</onright>
                    </control>
                    <control type="fixedlist" id="50">
                        <width>1920</width>
                        <height>1080</height>
                        <onup>50</onup>
                        <ondown>50</ondown>
                        <focusposition>3</focusposition>
                        <orientation>vertical</orientation>
                        <itemlayout height="150" width="1920">
                            <control type="image">
                                <aligny>center</aligny>
                                <left>100</left>
                                <width>80</width>
                                <aspectratio>keep</aspectratio>
                                <texture background="true">$INFO[ListItem.Icon]</texture>
                                <colordiffuse>80EEEEEE</colordiffuse>
                            </control>
                            <control type="label">
                                <aligny>center</aligny>
                                <left>225</left>
                                <width>600</width>
                                <height>150</height>
                                <font>Reg30</font>
                                <textcolor>80CFCFCF</textcolor>
                                <label>$INFO[ListItem.OriginalTitle]</label>
                            </control>
                            <control type="image">
                                <top>75</top>
                                <align>center</align>
                                <height>25</height>
                                <aspectratio>keep</aspectratio>
                                <texture background="true">rating/none.png</texture>
                            </control>
                            <control type="image">
                                <top>75</top>
                                <align>center</align>
                                <height>25</height>
                                <aspectratio>keep</aspectratio>
                                <texture background="true">$INFO[ListItem.UserRating,rating/,.png]</texture>
                            </control>
                            <control type="label">
                                <aligny>center</aligny>
                                <left>1100</left>
                                <width>600</width>
                                <height>150</height>
                                <font>Light30</font>
                                <textcolor>80CFCFCF</textcolor>
                                <label>$INFO[ListItem.Director]</label>
                            </control>
                            <control type="label">
                                <top>60</top>
                                <left>1650</left>
                                <width>250</width>
                                <height>150</height>
                                <font>Light30</font>
                                <textcolor>80CFCFCF</textcolor>
                                <label>$INFO[ListItem.Year]</label>
                            </control>
                            <control type="image">
                                <bottom>0</bottom>
                                <left>100</left>
                                <width>88%</width>
                                <height>2</height>
                                <aspectratio>stretch</aspectratio>
                                <texture background="true">general/separator.png</texture>
                            </control>
                        </itemlayout>

                        <focusedlayout height="180" width="1920">
                            <control type="group">
                                <animation effect="zoom" time="120" start="100" end="105" center="auto" tween="Back" easing="Out">Focus</animation>
                                <control type="image">
                                    <top>-100</top>
                                    <width>1950</width>
                                    <height>380</height>
                                    <aspectratio>scale</aspectratio>
                                    <texture background="true">general/focus_item.png</texture>
                                </control>
                                <control type="image">
                                    <aligny>center</aligny>
                                    <left>100</left>
                                    <width>100</width>
                                    <aspectratio>keep</aspectratio>
                                    <texture background="true">$INFO[ListItem.Icon]</texture>
                                </control>
                                <control type="fadelabel">
                                    <aligny>center</aligny>
                                    <left>250</left>
                                    <width>580</width>
                                    <font>Bold42</font>
                                    <textcolor>FFFFFFFF</textcolor>
                                    <label>$INFO[ListItem.OriginalTitle]</label>
                                    <textwidth>580</textwidth>
                                    <scroll>false</scroll>
                                </control>
                                <control type="image">
                                    <top>75</top>
                                    <align>center</align>
                                    <height>30</height>
                                    <aspectratio>keep</aspectratio>
                                    <texture background="true">rating/none.png</texture>
                                </control>
                                <control type="image">
                                    <top>75</top>
                                    <align>center</align>
                                    <height>30</height>
                                    <aspectratio>keep</aspectratio>
                                    <texture background="true">$INFO[ListItem.UserRating,rating/,.png]</texture>
                                </control>
                                <control type="label">
                                    <aligny>center</aligny>
                                    <left>1100</left>
                                    <width>600</width>
                                    <font>Light42</font>
                                    <textcolor>FFFFFFFF</textcolor>
                                    <label>$INFO[ListItem.Director]</label>
                                    <textwidth>480</textwidth>
                                </control>
                                <control type="label">
                                    <aligny>center</aligny>
                                    <left>1600</left>
                                    <font>Light42</font>
                                    <textcolor>FFFFFFFF</textcolor>
                                    <label>$INFO[ListItem.Year]</label>
                                </control>
                            </control>
                        </focusedlayout>
                    </control>
            </control>
    </include>
</includes>

I really need help on where to set an <onload> or <defaultcontrol always="true">98</defaultcontrol>.