What is the equivalent for onkeydown and onkeyup (Javascript events) in python?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 08:48:33

问题


There are events called 'onkeydown' and 'onkeyup' in Javascript. Can anyone please suggest the python equivalent of it?


回答1:


Without any external library, python can't provide GUI features, such as events handling. Listening to an event such onkeydown or onkeyup is thus impossible with the python sdl.

If you really want to react to these events, you must use an external library providing event-driven operations, such as the Qt binding PyQt, the TKinter module, or other libraries.



来源:https://stackoverflow.com/questions/29966204/what-is-the-equivalent-for-onkeydown-and-onkeyup-javascript-events-in-python

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