condition onfocus if/else
#1
have a layout with 2 controls, each control is visible with a condition, the problem is that I cant say which one have the default focus when is pressed select key.
I make each control have the same id and set this id as de default if but only request focus in first button the other control only work when select key is pressed twice
the layout is something like that

Code:
<?xml version="1.0" encoding="UTF-8"?>
    <window>
        <defaultcontrol always="true">1</defaultcontrol>
        <controls>
            <control id="1" type="button">
                <visible>CONDITION</visible>
                <description>DESC A</description>
                <posx>0</posx>
                <posy>0</posy>
                <width>1280</width>
                <height>720</height>
                <texturefocus>-</texturefocus>
                <texturenofocus>-</texturenofocus>
                <onclick>ACTION A</onclick>
            </control>
            <control id="1" type="button">
                <visible>CONDITION</visible>
                <description>DESC B</description>
                <posx>0</posx>
                <posy>0</posy>
                <width>1280</width>
                <height>720</height>
                <texturefocus>-</texturefocus>
                <texturenofocus>-</texturenofocus>
                <onclick>ACTION B</onclick>
            </control>
        </controls>
    </window>

any solution to fix that?
Reply
#2
Make it a togglebutton with conditional onclicks?
Reply
#3
dont work
still need to press 2 times on key_enter to win focus
Reply
#4
would this work for you:
Code:
<?xml version="1.0" encoding="UTF-8"?>
    <window>
        <onload condition="CONDITION1">SetFocus(1)</onload>
        <onload condition="CONDITION2">SetFocus(2)</onload>
        <controls>
            <control id="1" type="button">
                <visible>CONDITION1</visible>
                <description>DESC A</description>
                <posx>0</posx>
                <posy>0</posy>
                <width>1280</width>
                <height>720</height>
                <texturefocus>-</texturefocus>
                <texturenofocus>-</texturenofocus>
                <onclick>ACTION A</onclick>
            </control>
            <control id="2" type="button">
                <visible>CONDITION2</visible>
                <description>DESC B</description>
                <posx>0</posx>
                <posy>0</posy>
                <width>1280</width>
                <height>720</height>
                <texturefocus>-</texturefocus>
                <texturenofocus>-</texturenofocus>
                <onclick>ACTION B</onclick>
            </control>
        </controls>
    </window>
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
#5
already try but the 2nd onload overwrite the 1st onload
Reply
#6
already solve the problem

instead a togglebutton i use a button with 2 onlick each one have a condition
Reply

Logout Mark Read Team Forum Stats Members Help
condition onfocus if/else0