So, I was just messing around with the getKey variable to see if I could find any loopholes for measuring multiple key presses or measuring if the key is being held down. I came across some strange things and was wondering if anyone could explain to me why the Ti operating system acts this way.
So I started out with the most basic of programs to experiment on:
:Repeat G=105
:getKey -> G (-> is the store symbol)
:Disp G
:End
What I found was that if you press a key down and hold it, it does not measure it more than one time. (This was done on a Ti-83+ and a Ti-84+ SE) But, if you press the key down a few times at the same rate as it is displaying G, and then hold it down immediately, it will measure it every other time it displays. (Note, this can take a while to achieve if you don't have quick fingers.) What makes this happen internally?
The other observation I made was that with this program, if you press down a key and hold it, it will only measure it once. But, I made another program that uses output instead of disp to make a "O" move around the screen and output the key # in the corner. I found that when you hold the key down on this program, it measures it once, then measures 0, and then measures the key # for as long as the key is pressed. What makes this happen?
As a game designer who wants to get the best from Ti-Basic in his programs, These things interest me. Not only because I am fascinated by code and programming, but also because there may be potential loopholes for better control in my programs and games. If anyone knows enough about this subject to help, I would greatly appreciate it. I will continue experimenting and researching and post more updates here if there are any.
Thanks for reading!