python类MapVirtualKey()的实例源码

spotilib.py 文件源码 项目:Spotilyrics 作者: eitchtee 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def hwcode(Media):
    hwcode = win32api.MapVirtualKey(Media, 0)
    return hwcode
keycodes.py 文件源码 项目:remoteControlPPT 作者: htwenning 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def make_key_name(vk, flags):
    # Check alt keys.
    flags_done = 0
    parts = []
    for moddata in _checks:
        for name, checkflag in moddata:
            if flags & checkflag:
                parts.append(name)
                flags_done = flags_done & checkflag
                break
    if flags_done & flags:
        parts.append(hex( flags & ~flags_done ) )
    # Now the key name.
    if vk is None:
        parts.append("<Unknown scan code>")
    else:
        try:
            parts.append(key_code_to_name[vk])
        except KeyError:
            # Not in our virtual key map - ask Windows what character this
            # key corresponds to.
            scancode = win32api.MapVirtualKey(vk, MAPVK_VK_TO_CHAR)
            parts.append(unichr(scancode))
    sep = "+"
    if sep in parts: sep = "-"
    return sep.join([p.capitalize() for p in parts])
keycodes.py 文件源码 项目:CodeReader 作者: jasonrbr 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def make_key_name(vk, flags):
    # Check alt keys.
    flags_done = 0
    parts = []
    for moddata in _checks:
        for name, checkflag in moddata:
            if flags & checkflag:
                parts.append(name)
                flags_done = flags_done & checkflag
                break
    if flags_done & flags:
        parts.append(hex( flags & ~flags_done ) )
    # Now the key name.
    if vk is None:
        parts.append("<Unknown scan code>")
    else:
        try:
            parts.append(key_code_to_name[vk])
        except KeyError:
            # Not in our virtual key map - ask Windows what character this
            # key corresponds to.
            scancode = win32api.MapVirtualKey(vk, MAPVK_VK_TO_CHAR)
            parts.append(chr(scancode))
    sep = "+"
    if sep in parts: sep = "-"
    return sep.join([p.capitalize() for p in parts])
alt_song_freq.py 文件源码 项目:spotify-scraper 作者: naschorr 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def nextSong(self):
        keybd_event(0xB0, MapVirtualKey(0xB0, 0))
alt_song_freq.py 文件源码 项目:spotify-scraper 作者: naschorr 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def stopSong(self):
        keybd_event(0xB2, MapVirtualKey(0xB2, 0))
song_freq.py 文件源码 项目:spotify-scraper 作者: naschorr 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def nextSong(self):
        keybd_event(0xB0, MapVirtualKey(0xB0, 0))
song_freq.py 文件源码 项目:spotify-scraper 作者: naschorr 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def stopSong(self):
        keybd_event(0xB2, MapVirtualKey(0xB2, 0))
spotify_scraper.py 文件源码 项目:spotify-scraper 作者: naschorr 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def playSong(self):
        ## Play the song
        keybd_event(0xB3, MapVirtualKey(0xB3, 0))
        ## Restart the song
        keybd_event(0xB1, MapVirtualKey(0xB1, 0))


问题


面经


文章

微信
公众号

扫码关注公众号