python类VK_MENU的实例源码

editor.py 文件源码 项目:remoteControlPPT 作者: htwenning 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def OnKeyDown(self, msg):
        key = msg[2]
        if win32api.GetKeyState(win32con.VK_CONTROL) & 0x8000:
            modList = MODIFYING_VK_KEYS_CTRL
        elif win32api.GetKeyState(win32con.VK_MENU) & 0x8000:
            modList = MODIFYING_VK_KEYS_ALT
        else:
            modList = MODIFYING_VK_KEYS

        if key in modList:
            # Return 1 if we can make the file editable.(or it already is!)
            return self.GetDocument().CheckMakeDocumentWritable()
        return 1 # Pass it on OK

#   def OnKey(self, key):
#       return self.GetDocument().CheckMakeDocumentWritable()
bindings.py 文件源码 项目:remoteControlPPT 作者: htwenning 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def fire_key_event(self, msg):
        key = msg[2]
        keyState = 0
        if win32api.GetKeyState(win32con.VK_CONTROL) & 0x8000:
            keyState = keyState | win32con.RIGHT_CTRL_PRESSED | win32con.LEFT_CTRL_PRESSED
        if win32api.GetKeyState(win32con.VK_SHIFT) & 0x8000:
            keyState = keyState | win32con.SHIFT_PRESSED
        if win32api.GetKeyState(win32con.VK_MENU) & 0x8000:
            keyState = keyState | win32con.LEFT_ALT_PRESSED | win32con.RIGHT_ALT_PRESSED
        keyinfo = key, keyState
        # Special hacks for the dead-char key on non-US keyboards.
        # (XXX - which do not work :-(
        event = self.keymap.get( keyinfo )
        if event is None:
                return 1
        return self.fire(event, None)
editor.py 文件源码 项目:CodeReader 作者: jasonrbr 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def OnKeyDown(self, msg):
        key = msg[2]
        if win32api.GetKeyState(win32con.VK_CONTROL) & 0x8000:
            modList = MODIFYING_VK_KEYS_CTRL
        elif win32api.GetKeyState(win32con.VK_MENU) & 0x8000:
            modList = MODIFYING_VK_KEYS_ALT
        else:
            modList = MODIFYING_VK_KEYS

        if key in modList:
            # Return 1 if we can make the file editable.(or it already is!)
            return self.GetDocument().CheckMakeDocumentWritable()
        return 1 # Pass it on OK

#   def OnKey(self, key):
#       return self.GetDocument().CheckMakeDocumentWritable()
bindings.py 文件源码 项目:CodeReader 作者: jasonrbr 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def fire_key_event(self, msg):
        key = msg[2]
        keyState = 0
        if win32api.GetKeyState(win32con.VK_CONTROL) & 0x8000:
            keyState = keyState | win32con.RIGHT_CTRL_PRESSED | win32con.LEFT_CTRL_PRESSED
        if win32api.GetKeyState(win32con.VK_SHIFT) & 0x8000:
            keyState = keyState | win32con.SHIFT_PRESSED
        if win32api.GetKeyState(win32con.VK_MENU) & 0x8000:
            keyState = keyState | win32con.LEFT_ALT_PRESSED | win32con.RIGHT_ALT_PRESSED
        keyinfo = key, keyState
        # Special hacks for the dead-char key on non-US keyboards.
        # (XXX - which do not work :-(
        event = self.keymap.get( keyinfo )
        if event is None:
                return 1
        return self.fire(event, None)
FX_Keyboard.py 文件源码 项目:PyUIA 作者: xiaoxiayu 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def generateVirtualKey(self, key):
        keyMap = {
            "left": win32con.VK_LEFT,
            "down": win32con.VK_DOWN,
            "tab" : win32con.VK_TAB,
            "up": win32con.VK_UP,
            "right": win32con.VK_RIGHT,
            "ctrl" : win32con.VK_CONTROL,
            "esc" : win32con.VK_ESCAPE,
            "enter" : win32con.VK_RETURN,
            "alt" : win32con.VK_MENU,
            ";:" : 0xBA,
            "\\|" : 0xDC,
            ".>" : 0xBE,
            "-_" : 0xBD,
            "win" : 0x5B,
            "shift" : win32con.VK_SHIFT
        }
        if key in keyMap:
            return keyMap[key]
        else:
            return ord(key.upper())
action.py 文件源码 项目:pikaRL 作者: kooock 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def game_reset(self):
        #?? ?? ???????? ? ????
        win32api.keybd_event(win32con.VK_MENU, 0, 0, 0) #alt down
        time.sleep(self.interval_time)
        win32api.keybd_event(win32con.VK_MENU, 0, win32con.KEYEVENTF_KEYUP, 0) #alt up
        win32api.keybd_event(0x47, 0, 0, 0) # key'G' down
        time.sleep(0.01)
        win32api.keybd_event(0x47, 0, win32con.KEYEVENTF_KEYUP, 0) # key 'G' up
        win32api.keybd_event(0x52, 0, 0, 0) # key 'R' down
        time.sleep(0.01)
        win32api.keybd_event(0x52, 0, win32con.KEYEVENTF_KEYUP, 0) # key 'R' up
        self.game_start()
qq.py 文件源码 项目:CNKI-QQFriend 作者: hsluoyz 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def QQ_ToggleMessageRecord():
    win32api.keybd_event(win32con.VK_MENU, 0, 0, 0);
    win32api.keybd_event(ord('H'), 0, 0, 0);
    win32api.keybd_event(ord('H'), 0, win32con.KEYEVENTF_KEYUP, 0);
    win32api.keybd_event(win32con.VK_MENU, 0, win32con.KEYEVENTF_KEYUP, 0);

# Copy the last message.
qq.py 文件源码 项目:CNKI-QQFriend 作者: hsluoyz 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def QQ_CloseWindow():
    win32api.keybd_event(win32con.VK_MENU, 0, 0, 0);
    win32api.keybd_event(win32con.VK_F4, 0, 0, 0);
    win32api.keybd_event(win32con.VK_F4, 0, win32con.KEYEVENTF_KEYUP, 0);
    win32api.keybd_event(win32con.VK_MENU, 0, win32con.KEYEVENTF_KEYUP, 0);

# Get the clipboard into a str.


问题


面经


文章

微信
公众号

扫码关注公众号