使用Python临时更改光标
我正在编写一个脚本,该脚本拦截触摸板输出并在经过一些处理后发送到窗口。所以不涉及 GUI。我想在发生某些光标行为时临时更改光标。我已尽我所能在网上搜索,发现很少有帖子讨论使用 win32api.SetCursor() 但这根本不起作用。大多数帖子讨论使用 Tkinter 或 wxPython 更改光标。还有其他解决方案可以改变系统范围内的光标吗?
I am writing a script that intercepts a touchpad output and send to the windows after some processing. So there is no GUI involved. I want to change the cursor temporarily when certain cursor behavior occurs. I have searched the web to the best of my abilities and found very few posts that talked about using win32api.SetCursor() but this does not work at all. Most of the posts talks about changing cursor using Tkinter or wxPython. Is there any other solution to change the cursor system wide?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用光标下方的代码会在系统范围内更改,但我必须恢复到退出程序下方的箭头光标。如果还有其他更好的方法,我将不胜感激您的回复。
Using the code below the cursor is changed system-wide though I have to restored to the arrow cursor below quitting the program. If there are other better ways I would appreciate your response.
我希望这有帮助
I hope this helps