Kodi Community Forum
controlDown control not working - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: controlDown control not working (/showthread.php?tid=207977)



controlDown control not working - Pr0ph3cyTiger - 2014-11-03

Hi guys

I have got a problem with the controlDown control. I'm trying to navigate the button in python when I pressed on the down arrow button of the keyboard, but nothing will happens when I press on the down arrow button.

Code:
allchannels_enabled = ADDON.getSetting('allchannels.enabled') == 'true'

def onAction(self, action):
    if action == ACTION_MOVE_DOWN:
        if allchannels_enabled:
            self.button1 = self.getControl(4127)
            self.button2 = self.getControl(4131)
            self.button1.controlDown(self.button2)


Here is the skin button:

Code:
<control type="grouplist">
    <!--ROW 1-->
    <control type="group">                  
        <control type="button" id="4127">
            <description>Channel Button 1</description>
            <posx>0</posx>
            <posy>0</posy>
            <width>350</width>
            <height>34</height>
            <visible>true</visible>
            <texturefocus>channels_bar1.png</texturefocus>
            <texturenofocus>changelang_yellow.png</texturenofocus>
            <label>channel 1</label>
            <font>Font_Bold25</font>
            <textcolor>0xFF000000</textcolor>
            <disabledcolor>0xFFFFFFFF</disabledcolor>
            <align>left</align>
            <aligny>top</aligny>
            <pulseonselect></pulseonselect>
            <onclick></onclick>
            <onfocus>-</onfocus>
            <onup>2</onup>
            <ondown>3</ondown>
            <onleft>1</onleft>
            <onright>1</onright>
        </control>

    <!--ROW 2-->
    <control type="group">                  
        <control type="button" id="4131">
            <description>Channel Button 2</description>
            <posx>0</posx>
            <posy>0</posy>
            <width>350</width>
            <height>34</height>
            <visible>true</visible>
            <texturefocus>changelang_yellow.png</texturefocus>
            <texturenofocus>channels_bar1.png</texturenofocus>
            <label>channel 2</label>
            <font>Font_Bold25</font>
            <textcolor>0xFF000000</textcolor>
            <disabledcolor>0xFFFFFFFF</disabledcolor>
            <align>left</align>
            <aligny>top</aligny>
            <pulseonselect></pulseonselect>
            <onclick></onclick>
            <onfocus>-</onfocus>
            <onup>2</onup>
            <ondown>3</ondown>
            <onleft>1</onleft>
            <onright>1</onright>
        </control>
</control>


Can you please help me how do you go from one button to the next when they are selected as an action?