Пример #1
0
    def move_mouse_y(self, pixel_amount):
        ''' Move cursor on y axis by pixel_amount. Positive amount is down, negative is up '''
        if not pixel_amount:
            pixel_amount = 0
        else:
            pixel_amount = int(pixel_amount)

        if pixel_amount < 0:
            command_string = "xdotool mousemove_relative -- 0 {}".format(
                pixel_amount)
        else:
            command_string = "xdotool mousemove_relative 0 {}".format(
                pixel_amount)
        return commands.os_subprosses_handler(command_string,
                                              errors.XDOTOOL_GENERAL)
Пример #2
0
    def move_mouse_x(self, pixel_amount):
        ''' Move cursor on x axis by pixel_amount. Positive is right, negative is left '''
        if not pixel_amount:
            pixel_amount = 0
        else:
            pixel_amount = int(pixel_amount)

        if pixel_amount < 0:
            command_string = "xdotool mousemove_relative -- {} 0".format(
                pixel_amount)
        else:
            command_string = "xdotool mousemove_relative {} 0".format(
                pixel_amount)
        return commands.os_subprosses_handler(command_string,
                                              errors.XDOTOOL_GENERAL)
Пример #3
0
 def input_single_symbol(self, symbol):
     ''' Simulate input with symbol that xdotool understands '''
     command_string = "xdotool key --clearmodifiers {}".format(symbol)
     return commands.os_subprosses_handler(command_string,
                                           errors.XDOTOOL_GENERAL)
Пример #4
0
 def input_single_char(self, char):
     '''Change char to a value that xdotool understand and simulate input with it'''
     symbol = self.__char_to_xdotool_symbol(char)
     command_string = "xdotool key --clearmodifiers {}".format(symbol)
     return commands.os_subprosses_handler(command_string,
                                           errors.XDOTOOL_GENERAL)
Пример #5
0
 def left_mouse_click(self):
     ''' Simulate left mouse click'''
     command_string = "xdotool click 1"
     return commands.os_subprosses_handler(command_string,
                                           errors.XDOTOOL_GENERAL)
Пример #6
0
 def set_mouse_position(self, _x, _y):
     ''' set mouse to x y position '''
     command_string = "xdotool mousemove {} {}".format(_x, _y)
     print(command_string)
     return commands.os_subprosses_handler(command_string,
                                           errors.XDOTOOL_GENERAL)
def increase_master_volume() -> dict:
    ''' Increase system master volume '''
    return commands.os_subprosses_handler("xdotool key XF86AudioRaiseVolume",
                                          errors.XDOTOOL_GENERAL)
def mute_master_volume() -> dict:
    ''' Mute system master volume '''
    return commands.os_subprosses_handler("xdotool key XF86AudioMute",
                                          errors.XDOTOOL_GENERAL)