Posts: 664
Threads: 66
Joined: Nov 2023
Reputation:
7
Do you remember the line from The Simpsons when Homer is stressed... "Where's the ANY key?"
Here is my lame question... Is there a method / routine to simulate the ANY key without causing the CPU to chuck a fit? Similar to Basic's 'waitkey'
Logic is the beginning of wisdom.
Posts: 664
Threads: 66
Joined: Nov 2023
Reputation:
7
11-19-2025, 02:48 AM
(This post was last modified: 11-19-2025, 03:34 AM by johnno56.)
Just had a look through N6 docs... Nope... Nothing about wait key.
The game I am trying to convert/modify/adapt (more like butcher... lol) uses 'waitkey'... I will test both of your suggestions... I am not sure how, but I will try to work out how to monitor the impact on the CPU... could be fun! Thanks for the suggestions. Much appreciated.
Marcus,
Ran a small test to monitor the value of inkey() which always produced '0', unless a key is pressed, which then displayed the ASCII value of the key.
Then threw together the following. Quick and simple. Oh. Also monitored the CPU impact... an extra 0.04%
Code:
set window "Waitkey Test", 640, 480, false
set redraw off
do
set caret 320, 200
set color 255, 255, 0
center "Press ANY key to continue..."
if inkey() <> 0 break
redraw
fwait 60
until keydown(KEY_ESCAPE, true)
Will not be difficult to create a function... Now... My next concern is to decide which of my keys I am going to label as "any"... lol
Logic is the beginning of wisdom.