How to use python curses module to create a key event?

て烟熏妆下的殇ゞ 提交于 2019-12-04 21:26:18
Gringo Suave

Generating a keypress:

On Windows it is quite easy to generate keypresses. On Linux a bit more difficult:

Getting a key press:

Use of curses is a bit much for this case.

Events such as you describe are usually associated with some sort of GUI container (window, canvas, frame, what have you) so "events" really don't have any meaning without some sort of GUI. I could give a more detailed answer if you would say what GUI framework you are using, but barring that, here are links descibing how to handle events using TKInter and WxPython

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!