testing all RC buttons + executing my own code + forwarding RC code back to Enigma

  • Hi all.


    I have a question about the Python code, specifically using the Screens.Screen module defined as a subclass. Is there any way to test all the buttons from the remote control ? And when I press any key to execute my desired event (hide picture) and then put the original code further into Enigma ?


    The problem is also with the display of the warning icon for undesired remote control buttons (not defined for ActionMap). The crossover icon is displayed in the top left corner of the screen. I do not want to see any icon in this case.


    Even better explanation:


    I did not find anything from the source code on GitHub servers in the InfoBarGenerics.py file (Screens.InfoBarGenerics). There is a similar solution used to detect all RC buttons and hide the crossover icon ("/usr/share/enigma2/PLi-HD/icons/unhandled-key.png") in the upper left corner of the TV screen, but I do not understand it well yet.


    Detection of all RC buttons (their codes) I can do. But I don't know how to hide the cross on the unhandled (unused) button pressed. I need to completely hide this icon while detecting all RC buttons.


    I also do not know how to push the code of the RC button after ending my session (Screens.Screen) even further into the system for its original execution. I have to look at OpenWebif, where I hope to find some inspiration, ha ha. OpenWebif is a functional virtual remote in the web interface.



    Thanks.

    Einmal editiert, zuletzt von faraon6 () aus folgendem Grund: my main question was highlighted

  • So, the problem is solved...


    Prerequisite:


    Python
    import NavigationInstance
    from enigma import eActionMap
    from sys import maxint


    To detect all keys on RC:

    Python
    def main():
        eActionMap.getInstance().bindAction('', -maxint - 1, self.anyKeyWasPressed)
    
    
    def anyKeyWasPressed(keyCode, keyEvent):
        if keyCode == 108:
            # do anything
        else:
            pass

    Sending the RC key code to Enigma:

    Python
    def sendRCKeyToEnigma(codeRC):
        eActionMap.getInstance().keyPressed("dreambox remote control (native)", codeRC, 0) #press the button
        eActionMap.getInstance().keyPressed("dreambox remote control (native)", codeRC, 1) #release the button

    But this code does not work:
    (hidding the cross symbol from unhandled keys on RC)

    Python
    unhandledKeyDialog = session.instantiateDialog(UnhandledKey)
        # unhandledKeyDialog.setAnimationMode(0)
        # unhandledKeyDialog.neverAnimate()
        unhandledKeyDialog.hide()

    Einmal editiert, zuletzt von faraon6 ()