rawinput.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:dogtail 作者: vhumpa 项目源码 文件源码
def keyNameToKeyCode(keyName):
    """
    Use GDK to get the keycode for a given keystring.

    Note that the keycode returned by this function is often incorrect when
    the requested keystring is obtained by holding down the Shift key.

    Generally you should use uniCharToKeySym() and should only need this
    function for nonprintable keys anyway.
    """
    keymap = Gdk.Keymap.get_for_display(Gdk.Display.get_default())
    entries = keymap.get_entries_for_keyval(
        Gdk.keyval_from_name(keyName))
    try:
        return entries[1][0].keycode
    except TypeError:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号