0

I was wondering how the getKey command works and how to use it in Python, as there is no command like that (right?).

Somehow, StackOverflow does not like short questions. I was writing a program on my calculator and then I thought, why not put it to my computer using Python? But then I realized I could not because I don't know what to do with the getKey.

PhP
  • 82
  • 7

1 Answers1

2

Not sure about your question, but this is the use of the getKey command in Ti-Basic:

: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 returns a value which corresponds to a key on the Ti-"Keyboard". You can look up the key values in the picture below.

Ti-"keyboard"

To get this functionality in Python search this site for it. You could use .char and .keysym for this. More info:

Keypress detection Python

Community
  • 1
  • 1
Roundhouse
  • 98
  • 4
  • 12