Author Topic: GetKey Question  (Read 2760 times)

Cosmo

  • Guest
GetKey Question
« 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()       

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: GetKey Question
« Reply #1 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 ...

Cosmo

  • Guest
Re: GetKey Question
« Reply #2 on: February 08, 2014, 01:04:24 PM »
Thanks Markus.