Esempio n. 1
0
    def execute(self, filename: str, keyval: int):

        if keyval:
            Atspi.generate_keyboard_event(keyval, None,
                                          Atspi.KeySynthType.PRESSRELEASE)
        self.capture(
            filename=filename,
            window=self.props["window"],
            type=self.props["type"],
            x1=self.props["x1"],
            y1=self.props["y1"],
            x2=self.props["x2"],
            y2=self.props["y2"],
        )
Esempio n. 2
0
    def generateKeyboardEvent(self, keycode, keysym, kind):
        """
                Generates a keyboard event. One of the keycode or the keysym parameters
                should be specified and the other should be None. The kind parameter is 
                required and should be one of the KEY_PRESS, KEY_RELEASE, KEY_PRESSRELEASE,
                KEY_SYM, KEY_STRING, KEY_LOCKMODIFIERS, or KEY_UNLOCKMODIFIERS.

                @@param keycode: Hardware keycode or None
                @@type keycode: integer
                @@param keysym: Symbolic key string or None
                @@type keysym: string
                @@param kind: Kind of event to synthesize
                @@type kind: integer
                """
        if not self.has_implementations:
            self._set_default_registry()
        if keysym is None:
            keysym = ""
        Atspi.generate_keyboard_event(keycode, keysym, kind)
Esempio n. 3
0
        def generateKeyboardEvent(self, keycode, keysym, kind):
                """
                Generates a keyboard event. One of the keycode or the keysym parameters
                should be specified and the other should be None. The kind parameter is 
                required and should be one of the KEY_PRESS, KEY_RELEASE, KEY_PRESSRELEASE,
                KEY_SYM, or KEY_STRING.

                @@param keycode: Hardware keycode or None
                @@type keycode: integer
                @@param keysym: Symbolic key string or None
                @@type keysym: string
                @@param kind: Kind of event to synthesize
                @@type kind: integer
                """
                if not self.has_implementations:
                        self._set_default_registry ()
                if keysym is None:
                        keysym = ""
                Atspi.generate_keyboard_event (keycode, keysym, kind)
Esempio n. 4
0
def key_press(key_name):
    key_sym = name_to_sym(key_name)
    Atspi.generate_keyboard_event(key_sym, None, Atspi.KeySynthType.SYM)
Esempio n. 5
0
 def release_keycode(self, keycode):
     #print("release_keycode")
     Atspi.generate_keyboard_event(keycode, "", Atspi.KeySynthType.RELEASE)
Esempio n. 6
0
 def press_keycode(self, keycode):
     #print("press_keycode")
     Atspi.generate_keyboard_event(keycode, "", Atspi.KeySynthType.PRESS)
Esempio n. 7
0
 def press_key_string(self, string):
     #print("press_key_string")
     Atspi.generate_keyboard_event(0, string, Atspi.KeySynthType.STRING)
Esempio n. 8
0
def key_press(key_name):
    key_sym = name_to_sym(key_name)
    Atspi.generate_keyboard_event(key_sym,
                                  None,
                                  Atspi.KeySynthType.SYM)