当前位置: 首页>>代码示例>>Python>>正文


Python input.Mouse类代码示例

本文整理汇总了Python中autopilot.input.Mouse的典型用法代码示例。如果您正苦于以下问题:Python Mouse类的具体用法?Python Mouse怎么用?Python Mouse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Mouse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: drag_window_to_screen

def drag_window_to_screen(window, screen):
    """Drags *window* to *screen*

    :param autopilot.process.Window window: The window to drag
    :param integer screen: The screen to drag the *window* to
    :raises: **TypeError** if *window* is not a autopilot.process.Window

    """
    if not isinstance(window, Window):
        raise TypeError("Window must be a autopilot.process.Window")

    if window.monitor == screen:
        logger.debug("Window %r is already on screen %d." % (window.x_id, screen))
        return

    assert(not window.is_maximized)
    (win_x, win_y, win_w, win_h) = window.geometry
    (mx, my, mw, mh) = Display.create().get_screen_geometry(screen)

    logger.debug("Dragging window %r to screen %d." % (window.x_id, screen))

    mouse = Mouse.create()
    keyboard = Keyboard.create()
    mouse.move(win_x + win_w/2, win_y + win_h/2)
    keyboard.press("Alt")
    mouse.press()
    keyboard.release("Alt")

    # We do the movements in two steps, to reduce the risk of being
    # blocked by the pointer barrier
    target_x = mx + mw/2
    target_y = my + mh/2
    mouse.move(win_x, target_y, rate=20, time_between_events=0.005)
    mouse.move(target_x, target_y, rate=20, time_between_events=0.005)
    mouse.release()
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:35,代码来源:X11.py

示例2: setUp

 def setUp(self):
     self.setup_base_path()
     self.pointer = Pointer(Mouse.create())
     self.app = self.launch_test_application(self.BROWSER_QML_APP_LAUNCHER, self.get_browser_container_path())
     self.webviewContainer = self.get_webviewContainer()
     self.watcher = self.webviewContainer.watch_signal('resultUpdated(QString)')
     super(UbuntuHTML5TestCaseBase, self).setUp()
开发者ID:fczuardi,项目名称:ubuntu-html5-theme,代码行数:7,代码来源:__init__.py

示例3: activate

 def activate(self, double_click=True):
     tx = self.x + (self.width / 2)
     ty = self.y + (self.height / 2)
     m = Mouse.create()
     m.move(tx, ty)
     m.click(1)
     if double_click:
         m.click(1)
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:8,代码来源:dash.py

示例4: preview_key

    def preview_key(self):
        tx = self.x + (self.width / 2)
        ty = self.y + (self.height / 2)
        m = Mouse.create()
        m.move(tx, ty)

        k = Keyboard.create()
        k.press_and_release('Menu')
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:8,代码来源:dash.py

示例5: setUp

    def setUp(self):
        super(EmulatorTest, self).setUp()

        self.app = self.launch_test_application(FULL_PATH,
                                                app_type='gtk',
                                                emulator_base=AutopilotGtkEmulatorBase)
        self.pointing_device = Pointer(Mouse.create())
        self.assertThat(self.main_window.visible, Eventually(Equals(1)))
        self.status_label = self.app.select_single(BuilderName='statuslabel')
开发者ID:DanChapman1819,项目名称:autopilot-gtk-emulators,代码行数:9,代码来源:test_emulator.py

示例6: ensure_collapsed

 def ensure_collapsed(self):
     """Collapse the filter expander label, if it's not already"""
     if self.expanded:
         tx = self.x + self.width / 2
         ty = self.y + self.height / 2
         m = Mouse.create()
         m.move(tx, ty)
         m.click()
         self.expanded.wait_for(False)
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:9,代码来源:dash.py

示例7: ensure_expanded

 def ensure_expanded(self):
     """Expand the filter expander label, if it's not already"""
     if not self.expanded:
         tx = self.x + self.width / 2
         ty = self.y + self.height / 2
         m = Mouse.create()
         m.move(tx, ty)
         m.click()
         self.expanded.wait_for(True)
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:9,代码来源:dash.py

示例8: execute_action_by_id

 def execute_action_by_id(self, action_id):
     """Executes an action given by the id."""
     action = self.get_action_by_id(action_id)
     if action:
         tx = action.x + (action.width / 2)
         ty = action.y + (action.height / 2)
         m = Mouse.create()
         m.move(tx, ty)
         m.click()
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:9,代码来源:dash.py

示例9: __init__

    def __init__(self, *args, **kwargs):
        super(Launcher, self).__init__(*args, **kwargs)

        self.show_timeout = 1
        self.hide_timeout = 1
        self.in_keynav_mode = False
        self.in_switcher_mode = False

        self._mouse = Mouse.create()
        self._display = Display.create()
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:10,代码来源:launcher.py

示例10: navigate_right

    def navigate_right(self, count=1):
        """Navigate preview right"""
        navigator = self.get_right_navigator()

        tx = navigator.button_x + (navigator.button_width / 2)
        ty = navigator.button_y + (navigator.button_height / 2)
        m = Mouse.create()
        m.move(tx, ty)

        old_preview_initiate_count = self.preview_initiate_count

        for i in range(count):
            self.navigate_right_enabled.wait_for(True)
            m.click()
            self.preview_initiate_count.wait_for(GreaterThan(old_preview_initiate_count))
            old_preview_initiate_count = self.preview_initiate_count
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:16,代码来源:dash.py

示例11: setUp

    def setUp(self):
        super(UbiquityAutopilotTestCase, self).setUp()
        self.app = self.launch_application()

        self.pointing_device = Pointer(Mouse.create())
        self.kbd = Keyboard.create()
        self.current_page_title = ''
        self.previous_page_title = ''
        self.current_step = ''
        self.step_before = ''
        self.english_install = False
        english_label_conf.generate_config()
        self.english_config = configparser.ConfigParser()
        self.english_config.read('/tmp/english_config.ini')
        #delete config at end of test
        self.addCleanup(os.remove, '/tmp/english_config.ini')
        # always starts with 1 row ('/dev/sda')
        self.part_table_rows = 1
        self.total_number_partitions = 0
开发者ID:hamonikr-root,项目名称:ubiquity,代码行数:19,代码来源:__init__.py

示例12: __init__

 def __init__(self, *args, **kwargs):
     super(WindowButton, self).__init__(*args, **kwargs)
     self._mouse = Mouse.create()
开发者ID:jonjahren,项目名称:unity,代码行数:3,代码来源:panel.py

示例13: __init__

 def __init__(self, *args):
     super(GtkContainers, self).__init__(*args)
     self.pointing_device = Pointer(Mouse.create())
开发者ID:hamonikr-root,项目名称:ubiquity,代码行数:3,代码来源:gtkcontainers.py

示例14: __init__

 def __init__(self, *args):
     super(GtkNoteBookPageAccessible, self).__init__(*args)
     self.pointing_device = Pointer(Mouse.create())
开发者ID:GalliumOS,项目名称:ubiquity,代码行数:3,代码来源:gtkaccessible.py

示例15: __init__

 def __init__(self, *args):
     super(GtkSwitch, self).__init__(*args)
     self.pointing_device = Pointer(Mouse.create())
开发者ID:DanChapman1819,项目名称:autopilot-gtk-emulators,代码行数:3,代码来源:gtkcontrols.py


注:本文中的autopilot.input.Mouse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。