Ticket #737: keyhandler.py.patch

File keyhandler.py.patch, 1.6 KB (added by pgf, 15 years ago)
  • keyhandler.py

    old new  
    164164        view.Shell.get_instance().set_zoom_level(ShellModel.ZOOM_ACTIVITY)
    165165
    166166    def handle_brightness_max(self):
     167
     168        # patch v1 by olpc-powerd
     169        if os.path.exists("/usr/bin/olpc-brightness"):
     170           os.system("/usr/bin/olpc-brightness high")
     171           return
     172
    167173        self._change_brightness(value=_BRIGHTNESS_MAX)
    168174
    169175    def handle_brightness_min(self):
     176
     177        # patch v1 by olpc-powerd
     178        if os.path.exists("/usr/bin/olpc-brightness"):
     179           os.system("/usr/bin/olpc-brightness low")
     180           return
     181
    170182        self._change_brightness(value=0)
    171183
    172184    def handle_volume_max(self):
     
    176188        self._change_volume(value=0)
    177189
    178190    def handle_brightness_up(self):
     191
     192        # patch v1 by olpc-powerd
     193        if os.path.exists("/usr/bin/olpc-brightness"):
     194           os.system("/usr/bin/olpc-brightness up")
     195           return
     196
    179197        self._change_brightness(step=_BRIGHTNESS_STEP)
    180198
    181199    def handle_brightness_down(self):
     200
     201        # patch v1 by olpc-powerd
     202        if os.path.exists("/usr/bin/olpc-brightness"):
     203           os.system("/usr/bin/olpc-brightness down")
     204           return
     205
     206
    182207        self._change_brightness(step=-_BRIGHTNESS_STEP)
    183208
    184209    def handle_volume_up(self):
     
    196221
    197222    def handle_rotate(self):
    198223
     224        # patch v2 by olpc-kbdshim
     225        if os.path.exists("/usr/bin/olpc-rotate"):
     226           os.system("/usr/bin/olpc-rotate")
     227           return
     228
     229
    199230        """
    200231        Handles rotation of the display (using xrandr) and of the d-pad.
    201232