Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道 getKey 命令是如何工作的以及如何在 Python 中使用它,因为没有这样的命令(对吗?)。
不知何故,StackOverflow 不喜欢简短的问题。我在我的计算器上写了一个程序,然后我想,为什么不用 Python 把它放到我的电脑上呢?但后来我意识到我不能,因为我不知道如何处理 getKey。
不确定您的问题,但这是 Ti-Basic 中 getKey 命令的使用:
:While 1 #loop :Repeat X #make sure a key is presssed :getKey→X #store that key in a variable :End #end loop :Disp X :End
getKey 返回一个与 Ti-“键盘”上的键对应的值。您可以在下图中查找关键值。
要在 Python 中获得此功能,请搜索此站点。你可以使用.charand.keysym为此。更多信息:
.char
.keysym
按键检测 Python