Post Reply 
Can I access keys by their names
07-24-2016, 07:06 PM
Post: #1
Can I access keys by their names
So far when I have wanted to check for a user key, I have checked for that keys HP number, thus IF KK==4 for ESC.

If you have a lot of keys to check for, or in the interests of portability, an alternative would be preferred. I had thought to use the key name (listed under user key customisation), but that name is giving me a syntax error if I simply replace the "4" with "K_Esc".

Code:


 //KK
 EXPORT KK()
 BEGIN
  LOCAL KK;
  WHILE 1 DO
   KK:=GETKEY();
   IF KK≠−1 THEN
    PRINT(KK);
    IF KK==4 THEN // I  cannot use K_Esc
     MSGBOX("ESCAPE");
    END;
   END; 
  END;
 
 END;

Am I missing something obvious to use those key names for checking for keys?
Or is there a better way?

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Can I access keys by their names - StephenG1CMZ - 07-24-2016 07:06 PM



User(s) browsing this thread: 1 Guest(s)