[futurebasic] more getkeys stuff -- dancing with mel...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1997 : Group Archive : Group : All Groups

From: Bowerbird@...
Date: Sat, 29 Nov 1997 04:46:28 -0500 (EST)
'  "how did mel get those numbers?", you ask.

'  here's how to get the getkeys numbers for any key...

COMPILE 0,_caseinsensitive
DIM gkeys(7)
END GLOBALS

WINDOW 1,"",(0,0)-(500,300),_dialogshadow
PRINT "press any key to reveal its getkeys numbers..."

DO
  
  CALL GETKEYS(gkeys(0))
  
  ' this tells you what the numbers are for each key...
  FOR i%=0 TO 7
    IF gkeys(i%)<>0 THEN PRINT i%,gkeys(i%),,"click mouse to quit..."
  NEXT
  
  '  once you know the numbers, here's how you test for them...
  LONG IF gkeys(3)=512
    COLOR _zblue
    PRINT ,,,"that's the spacebar..."
    COLOR _zblack
  END IF
  
  LONG IF gkeys(3)=-32768 AND gkeys(2)=128
    COLOR _zred
    PRINT ,,,"that's <command>+<.>"
    COLOR _zblack
  END IF
  
UNTIL FN BUTTON