阅读背景:

在linux机器上检测python 3中按键的最简单方法是什么?

来源:互联网 

Right now I'm trying to make a small code with a raspberry pi and and a makey makey. The makey makey is a small board that acts as a usb keyboard when certain contacts are powered. My question is what is the easiest way to detect those keypresses inside a python script. I understand using the GPIO pins would be easier, but right now I'm looking for this. I have seen examples such as using using getch() from msvcrt (which from what I understand is windows only,) using pygame.key, and using getKey. Which of theses is easiest to use? Are there any that can detect a key being pressed and a key being released?Right now I'm trying to make a small code with




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: