當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。