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


Python X.CurrentTime方法代码示例

本文整理汇总了Python中Xlib.X.CurrentTime方法的典型用法代码示例。如果您正苦于以下问题:Python X.CurrentTime方法的具体用法?Python X.CurrentTime怎么用?Python X.CurrentTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xlib.X的用法示例。


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

示例1: listen

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def listen(self):
        self.grab()
        while True:
            evt = self.disp.next_event()
            if evt.type in [X.KeyPress, X.KeyRelease]:
                keycode = evt.detail
                keysym = self.disp.keycode_to_keysym(keycode, 0)
                char = XK.keysym_to_string(keysym)
                self.disp.allow_events(X.ReplayKeyboard, X.CurrentTime)

                self.mode(self, evt, char)

            if evt.type == X.DestroyNotify:
                if evt.window.id == self.id:
                    self.ungrab()
                    return 
开发者ID:gillescastel,项目名称:inkscape-shortcut-manager,代码行数:18,代码来源:main.py

示例2: set_screen_config

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def set_screen_config(self, size_id, rotation, config_timestamp, rate=0, timestamp=X.CurrentTime):
    """Sets the screen to the specified size, rate, rotation and reflection.

    rate can be 0 to have the server select an appropriate rate.

    """
    return SetScreenConfig(
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        drawable=self,
        timestamp=timestamp,
        config_timestamp=config_timestamp,
        size_id=size_id,
        rotation=rotation,
        rate=rate,
        ) 
开发者ID:python-xlib,项目名称:python-xlib,代码行数:18,代码来源:randr.py

示例3: set_panning

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def set_panning(self, crtc, left, top, width, height, track_left, track_top, track_width, track_height, border_left, border_top, border_width, border_height, timestamp=X.CurrentTime):
    return SetPanning (
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        crtc=crtc,
        left=left,
        top=top,
        width=width,
        height=height,
        track_left=track_left,
        track_top=track_top,
        track_width=track_width,
        track_height=track_height,
        border_left=border_left,
        border_top=border_top,
        border_width=border_width,
        border_height=border_height,
        timestamp=timestamp,
        ) 
开发者ID:python-xlib,项目名称:python-xlib,代码行数:21,代码来源:randr.py

示例4: __sendKeyPressEvent

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def __sendKeyPressEvent(self, keyCode, modifiers, theWindow=None):
        if theWindow is None:
            focus = self.localDisplay.get_input_focus().focus
        else:
            focus = theWindow
        keyEvent = event.KeyPress(
                                  detail=keyCode,
                                  time=X.CurrentTime,
                                  root=self.rootWindow,
                                  window=focus,
                                  child=X.NONE,
                                  root_x=1,
                                  root_y=1,
                                  event_x=1,
                                  event_y=1,
                                  state=modifiers,
                                  same_screen=1
                                  )
        focus.send_event(keyEvent) 
开发者ID:autokey,项目名称:autokey,代码行数:21,代码来源:interface.py

示例5: __sendKeyReleaseEvent

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def __sendKeyReleaseEvent(self, keyCode, modifiers, theWindow=None):
        if theWindow is None:
            focus = self.localDisplay.get_input_focus().focus
        else:
            focus = theWindow
        keyEvent = event.KeyRelease(
                                  detail=keyCode,
                                  time=X.CurrentTime,
                                  root=self.rootWindow,
                                  window=focus,
                                  child=X.NONE,
                                  root_x=1,
                                  root_y=1,
                                  event_x=1,
                                  event_y=1,
                                  state=modifiers,
                                  same_screen=1
                                  )
        focus.send_event(keyEvent) 
开发者ID:autokey,项目名称:autokey,代码行数:21,代码来源:interface.py

示例6: sendKey

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def sendKey(window, keycode, modifiers=0, released=True):
    if released:
        type = KeyRelease
        event_class = KeyReleaseEvent
    else:
        type = KeyPress
        event_class = KeyPressEvent
    event = event_class(
        type=type,
        detail=keycode,
        time=CurrentTime,
        root=NONE,
        window=window,
        child=NONE,
        root_x=0,
        root_y=0,
        event_x=0,
        event_y=0,
        state=modifiers,
        same_screen=1)
    window.send_event(event)
    window.display.flush() 
开发者ID:tuwid,项目名称:darkc0de-old-stuff,代码行数:24,代码来源:x11.py

示例7: event

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def event(self, name, detail, state):
        return name(
            time=X.CurrentTime,
            root=self.root,
            window=self.inkscape,
            same_screen=0, child=Xlib.X.NONE,
            root_x=0, root_y=0, event_x=0, event_y=0,
            state=state,
            detail=detail
        ) 
开发者ID:gillescastel,项目名称:inkscape-shortcut-manager,代码行数:12,代码来源:main.py

示例8: setCurrentDesktop

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def setCurrentDesktop(self, i):
        """
        Set the current desktop (property _NET_CURRENT_DESKTOP).

        :param i: the desired desktop number"""
        self._setProperty('_NET_CURRENT_DESKTOP', [i, X.CurrentTime]) 
开发者ID:parkouss,项目名称:pyewmh,代码行数:8,代码来源:ewmh.py

示例9: setActiveWindow

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def setActiveWindow(self, win):
        """
        Set the given window active (property _NET_ACTIVE_WINDOW)

        :param win: the window object"""
        self._setProperty('_NET_ACTIVE_WINDOW', [1, X.CurrentTime, win.id],
                          win) 
开发者ID:parkouss,项目名称:pyewmh,代码行数:9,代码来源:ewmh.py

示例10: _getMouseEvent

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def _getMouseEvent():
    screen = _display.screen()
    window = screen.root
    window.grab_pointer(1, X.PointerMotionMask|X.ButtonReleaseMask|X.ButtonPressMask, X.GrabModeAsync, X.GrabModeAsync, X.NONE, X.NONE, X.CurrentTime)
    e = _display.next_event()
    _display.ungrab_pointer(X.CurrentTime)

    if e.type == X.ButtonPress:
        e = MOUSE_EVENT[e.detail] + '_down'
    elif e.type == X.ButtonRelease:
        e = MOUSE_EVENT[e.detail] + '_up'
    else:
        e = 'moving'
    return e 
开发者ID:AXeL-dev,项目名称:Dindo-Bot,代码行数:16,代码来源:_pyautogui_x11.py

示例11: _1_0set_screen_config

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def _1_0set_screen_config(self, size_id, rotation, config_timestamp, timestamp=X.CurrentTime):
    """Sets the screen to the specified size and rotation.

    """
    return _1_0SetScreenConfig(
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        drawable=self,
        timestamp=timestamp,
        config_timestamp=config_timestamp,
        size_id=size_id,
        rotation=rotation,
        ) 
开发者ID:python-xlib,项目名称:python-xlib,代码行数:15,代码来源:randr.py

示例12: set_crtc_config

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def set_crtc_config(self, crtc, config_timestamp, x, y, mode, rotation, outputs, timestamp=X.CurrentTime):
    return SetCrtcConfig (
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        crtc=crtc,
        config_timestamp=config_timestamp,
        x=x,
        y=y,
        mode=mode,
        rotation=rotation,
        outputs=outputs,
        timestamp=timestamp,
        ) 
开发者ID:python-xlib,项目名称:python-xlib,代码行数:15,代码来源:randr.py

示例13: fake_input

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def fake_input(self, event_type, detail = 0, time = X.CurrentTime,
               root = X.NONE, x = 0, y = 0):

    FakeInput(display = self.display,
              opcode = self.display.get_extension_major(extname),
              event_type = event_type,
              detail = detail,
              time = time,
              root = root,
              x = x,
              y = y) 
开发者ID:python-xlib,项目名称:python-xlib,代码行数:13,代码来源:xtest.py

示例14: __grab_keyboard

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def __grab_keyboard(self):
        focus = self.localDisplay.get_input_focus().focus
        focus.grab_keyboard(True, X.GrabModeAsync, X.GrabModeAsync, X.CurrentTime)
        self.localDisplay.flush() 
开发者ID:autokey,项目名称:autokey,代码行数:6,代码来源:interface.py

示例15: __ungrabKeyboard

# 需要导入模块: from Xlib import X [as 别名]
# 或者: from Xlib.X import CurrentTime [as 别名]
def __ungrabKeyboard(self):
        self.localDisplay.ungrab_keyboard(X.CurrentTime)
        self.localDisplay.flush() 
开发者ID:autokey,项目名称:autokey,代码行数:5,代码来源:interface.py


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