We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
def get_text(hwnd): length = ctypes.windll.user32.SendMessageW(hwnd, win32con.WM_GETTEXTLENGTH) buf = ctypes.create_unicode_buffer(length + 1) ctypes.windll.user32.SendMessageW(hwnd, win32con.WM_GETTEXT, length, ctypes.byref(buf)) # 这里的length改成length+1,否则中文存在切断变成一个问号 return buf.value
def hot_key(keys): time.sleep(sleep_time) for key in keys: win32api.keybd_event(VK_CODE[key], 0, 0, 0) # 这里插入一个小的延时,否则有时候两次键盘虚拟事件太快,导致失效 time.sleep(0.01) for key in reversed(keys): win32api.keybd_event(VK_CODE[key], 0, win32con.KEYEVENTF_KEYUP, 0)
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
def get_text(hwnd):
length = ctypes.windll.user32.SendMessageW(hwnd, win32con.WM_GETTEXTLENGTH)
buf = ctypes.create_unicode_buffer(length + 1)
ctypes.windll.user32.SendMessageW(hwnd, win32con.WM_GETTEXT, length, ctypes.byref(buf)) # 这里的length改成length+1,否则中文存在切断变成一个问号
return buf.value
def hot_key(keys):
time.sleep(sleep_time)
for key in keys:
win32api.keybd_event(VK_CODE[key], 0, 0, 0)
# 这里插入一个小的延时,否则有时候两次键盘虚拟事件太快,导致失效
time.sleep(0.01)
for key in reversed(keys):
win32api.keybd_event(VK_CODE[key], 0, win32con.KEYEVENTF_KEYUP, 0)
The text was updated successfully, but these errors were encountered: