Using the _key commands
#2
Phil

Add this line, Locate 10, 10: Print n:n = n + 1,
Then run it
Then move the _Limit 30 to be before the GetAnAction: label and run it again to see the difference.

_KeyClear
Print "hit a key"

GetAnAction:
_Limit 30 '                                              limit resource usage
k = _KeyHit '                                            get code of key press
Locate 12, 40: Print k; Space$(15) '                      erase previous key code
'###
Locate 10, 10: Print n:n = n + 1
'####
If k < 1 Then GoTo GetAnAction '                        if there are no keys pressed, have another look - but only do this max 30 times per second
Locate 13, 1: Print Space$(20); '                        erase previous key code announcement
Locate 13, 1
Print "ok, saw"; k '                                    announce key that was recognized
GoTo GetAnAction '                                      look for another key press
Reply


Messages In This Thread
Using the _key commands - by PhilOfPerth - 11-23-2022, 02:23 AM
RE: Using the _key commands - by King Mocker - 11-23-2022, 02:37 AM
RE: Using the _key commands - by SMcNeill - 11-23-2022, 02:42 AM
RE: Using the _key commands - by PhilOfPerth - 11-23-2022, 02:49 AM



Users browsing this thread: 1 Guest(s)