RetroBASIC

Retrogamecoding(.org) => EGSL => Topic started by: Cosmo on February 07, 2014, 11:11:20 PM

Title: GetKey Question
Post by: Cosmo on February 07, 2014, 11:11:20 PM
Hi Markus,

If getkey is not pressed, what is the return value ?
It isn't zero!

e.g
Code: [Select]
local press=0
repeat
   k=getkey()
   if k==32 and press==0 then
      color(255,255,255)
      drawtext (10,10,"HELLO")
      press=1
   end
   sync()
   if k==0 then  press=0; end
until k==27
closewindow()       
Title: Re: GetKey Question
Post by: Cybermonkey on February 08, 2014, 11:15:55 AM
Maybe a random value? Don't know for sure, that can differ from OS to OS. You can get the value yourself with:
Code: [Select]
repeat
cls()
drawtext (0,0,getkey())
etc ...
Title: Re: GetKey Question
Post by: Cosmo on February 08, 2014, 01:04:24 PM
Thanks Markus.