I tried to recreate the cursor screen that some Apps have, where the cursor moves faster across the screen the longer a button is held down.
Note - this works without quick keys.
:ClrDraw
:CoordOff
:GridOff
:AxesOff
:0→Xmin:1→ΔX
:0→Ymin:1→ΔY
:47→A:31→B:1→C
:Repeat K=45
:getKey→K
:Line(A,B,A+2,B
:Line(A,B,A,B-2 //cursor
:Line(A,B,A+2,B-2
:While K and K≠45 //while a button other than [CLEAR] is being held down(only works with repeating keys(DEL and the arrow keys))
:getKey→K
:Line(A,B,A+2,B,0
:Line(A,B,A,B-2,0
:Line(A,B,A+2,B-2,0
:A+C(K=26)(A+C≤92)-C(K=24)(A-C≥0)+(K=26)(A+C>92)(A+1≤92)-(K=24)(A-C<0)(A-1≥0→A //moves cursor by C unless new position of cursor would be off screen, in which it will only move cursor by 1
:B+C(K=25)(B+C≤62)-C(K=34)(B-C≥2)+(K=25)(B+C>62)(B+1≤62)-(K=34)(B-C<2)(B-1≥2→B
:Line(A,B,A+2,B
:Line(A,B,A,B-2
:Line(A,B,A+2,B-2
:C+1→C //increases the distance that the cursor moves
:End
:1→C //restores original value of C when a button is no longer being held down
:End
:ClrDraw
:ClrHome
:Output(1,1,"
This code probably isn't completely optimized, so could someone optimize it?
Oh, and one of the things about this program is that you can't move your cursor by just tapping a button. You actually have to hold down the button if you want to move it at all… if anyone wants to fix this you can