Ejemplo n.º 1
0
    def getKeyBindings(self):
        """Defines the key bindings for this script. Setup the default
        key bindings, then add one in for toggling whether we prefix
        chat room messages with the name of the chat room.

        Returns an instance of keybindings.KeyBindings.
        """

        debug.println(self.debugLevel, "gaim.getKeyBindings.")

        keyBindings = default.Script.getKeyBindings(self)
        keyBindings.add(
            keybindings.KeyBinding(
                "h", 1 << settings.MODIFIER_ORCA, 1 << settings.MODIFIER_ORCA,
                self.inputEventHandlers["togglePrefixHandler"]))

        # In gaim/pidgin, we are overriding the default script's bookmark
        # feature and keybindings to provide chat room message history.
        #
        messageKeys = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
        for messageKey in messageKeys:
            keyBindings.add(
                keybindings.KeyBinding(
                    messageKey, 1 << settings.MODIFIER_ORCA,
                    1 << settings.MODIFIER_ORCA,
                    self.inputEventHandlers["goToBookmark"]))

        return keyBindings
Ejemplo n.º 2
0
    def getAppKeyBindings(self):
        """Returns the application-specific keybindings for this script."""

        keyBindings = keybindings.KeyBindings()

        keyBindings.add(
            keybindings.KeyBinding(
                "a",
                keybindings.defaultModifierMask,
                keybindings.ORCA_MODIFIER_MASK,
                self.inputEventHandlers["presentInputLineHandler"]))

        keyBindings.add(
            keybindings.KeyBinding(
                "r",
                keybindings.defaultModifierMask,
                keybindings.ORCA_MODIFIER_MASK,
                self.inputEventHandlers["setDynamicColumnHeadersHandler"],
                1))

        keyBindings.add(
            keybindings.KeyBinding(
                "r",
                keybindings.defaultModifierMask,
                keybindings.ORCA_MODIFIER_MASK,
                self.inputEventHandlers["clearDynamicColumnHeadersHandler"],
                2))

        keyBindings.add(
            keybindings.KeyBinding(
                "c",
                keybindings.defaultModifierMask,
                keybindings.ORCA_MODIFIER_MASK,
                self.inputEventHandlers["setDynamicRowHeadersHandler"],
                1))

        keyBindings.add(
            keybindings.KeyBinding(
                "c",
                keybindings.defaultModifierMask,
                keybindings.ORCA_MODIFIER_MASK,
                self.inputEventHandlers["clearDynamicRowHeadersHandler"],
                2))

        bindings = self.structuralNavigation.keyBindings
        for keyBinding in bindings.keyBindings:
            keyBindings.add(keyBinding)

        return keyBindings
Ejemplo n.º 3
0
    def getAppKeyBindings(self):
        """Returns the application-specific keybindings for this script."""

        keyBindings = keybindings.KeyBindings()

        messageKeys = ["F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9"]
        for messagekey in messageKeys:
            keyBindings.add(
                keybindings.KeyBinding(
                    messagekey, keybindings.defaultModifierMask,
                    keybindings.ORCA_MODIFIER_MASK,
                    self.inputEventHandlers["readPreviousMessageHandler"]))

        return keyBindings
Ejemplo n.º 4
0
    def getKeyBindings(self):

        debug.println(self.debugLevel, "gnome-mud.getKeyBindings.")

        keyBindings = default.Script.getKeyBindings(self)

        #Here we define keybindings alt+1 to alt+0. We chosen the alt modifier
        #to don't interfere with the laptop keybindings 7, 8 and 9.
        messageKeys = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
        for i in range(0, len(messageKeys)):
            keyBindings.add(
                keybindings.KeyBinding(
                    messageKeys[i],
                    1 << atspi.Accessibility.MODIFIER_ALT,
                    1 << atspi.Accessibility.MODIFIER_ALT,
                    self.inputEventHandlers["readPreviousMessageHandler"]))

        return keyBindings
Ejemplo n.º 5
0
    f = os.popen("acpi")
    braille.displayMessage(f.read(80))
    f.close()
    return True


def decirHoraYFecha(script, inputEvent=None):
    speech.speak(strftime("Son las %H y %M, %A, %d de %B de %Y", localtime()))
    braille.displayMessage(strftime("%H:%M | %d/%m/%Y", localtime()))

    return True


decirInfoBateriaHandler = input_event.InputEventHandler(
    decirInfoBateria, _("Lee el estado de la batería"))
decirHoraYFechaHandler = input_event.InputEventHandler(
    decirHoraYFecha, _("Dicela hora y fecha"))

teclas = keybindings.KeyBindings()

teclas.add(
    keybindings.KeyBinding("h", 1 << settings.MODIFIER_ORCA,
                           1 << settings.MODIFIER_ORCA,
                           decirHoraYFechaHandler))
teclas.add(
    keybindings.KeyBinding("e", 1 << settings.MODIFIER_ORCA,
                           1 << settings.MODIFIER_ORCA,
                           decirInfoBateriaHandler))
settings.keyBindingsMap = {}
settings.keyBindingsMap["default"] = teclas