_nixmouse.py 文件源码

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

项目:mouse 作者: boppreh 项目源码 文件源码
def build_display():
    global display, window, x11
    if display and window and x11: return
    x11 = ctypes.cdll.LoadLibrary(ctypes.util.find_library('X11'))
    # Required because we will have multiple threads calling x11,
    # such as the listener thread and then main using "move_to".
    x11.XInitThreads()
    display = x11.XOpenDisplay(None)
    # Known to cause segfault in Fedora 23 64bits, no known workarounds.
    # http://stackoverflow.com/questions/35137007/get-mouse-position-on-linux-pure-python
    window = x11.XDefaultRootWindow(display)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号