daily pastebin goal
19%
SHARE
TWEET

key_to_string(keycode)

SpriterDrag May 16th, 2018 121 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///key_to_string(keycode);
  2.  
  3. /*
  4. **  Usage:
  5. **      key_to_string(keycode);
  6. **
  7. **  Given:
  8. **      keycode     Value of the key to return
  9. **
  10. **  Purpose:
  11. **      Return the name of the key given on argument[0]
  12. */
  13.  
  14. switch (argument0) {
  15.    
  16.     //Backspace
  17.     case (8): return "backspace"; break;
  18.    
  19.     //Tab
  20.     case (9): return "tab"; break;
  21.    
  22.     //Numpad middle
  23.     case (12): return "numpad middle"; break;
  24.    
  25.     //Enter
  26.     case (13): return "enter"; break;
  27.    
  28.     //Shift
  29.     case (16): return "shift"; break;
  30.    
  31.     //Control
  32.     case (17): return "control"; break;
  33.  
  34.     //Alt
  35.     case (18): return "alt"; break;
  36.    
  37.     //Pause
  38.     case (19): return "pause"; break;
  39.    
  40.     //Caps Lock
  41.     case (20): return "caps lock"; break;
  42.    
  43.     //Escape
  44.     case (27): return "escape"; break;
  45.  
  46.     //Space
  47.     case (32): return "space"; break;
  48.    
  49.     //Page Up
  50.     case (33): return "page up"; break;
  51.    
  52.     //Page Down
  53.     case (34): return "page down"; break;
  54.    
  55.     //End
  56.     case (35): return "end"; break;
  57.    
  58.     //Home
  59.     case (36): return "home"; break;
  60.    
  61.     //Left
  62.     case (37): return "left"; break;
  63.    
  64.     //Up
  65.     case (38): return "up"; break;
  66.    
  67.     //Right
  68.     case (39): return "right"; break;
  69.    
  70.     //Down
  71.     case (40): return "down"; break;
  72.    
  73.     //Print Screen
  74.     case (44): return "print screen"; break;
  75.    
  76.     //Insert
  77.     case (45): return "insert"; break;
  78.    
  79.     //Delete
  80.     case (46): return "delete"; break;
  81.  
  82.     //Left Windows
  83.     case (91): return "left windows"; break;
  84.  
  85.     //Right Windows
  86.     case (92): return "right windows"; break;
  87.    
  88.     //Menu
  89.     case (93): return "menu"; break;
  90.    
  91.     //Numpad 0
  92.     case (96): return "numpad 0"; break;
  93.  
  94.     //Numpad 1
  95.     case (97): return "numpad 1"; break;
  96.    
  97.     //Numpad 2
  98.     case (98): return "numpad 2"; break;
  99.    
  100.     //Numpad 3
  101.     case (99): return "numpad 3"; break;
  102.    
  103.     //Numpad 4
  104.     case (100): return "numpad 4"; break;
  105.    
  106.     //Numpad 5
  107.     case (101): return "numpad 5"; break;
  108.    
  109.     //Numpad 6
  110.     case (102): return "numpad 6"; break;
  111.  
  112.     //Numpad 7
  113.     case (103): return "numpad 7"; break;
  114.    
  115.     //Numpad 8
  116.     case (104): return "numpad 8"; break;
  117.    
  118.     //Numpad 9
  119.     case (105): return "numpad 9"; break;
  120.    
  121.     //Numpad *
  122.     case (106): return "numpad *"; break;
  123.  
  124.     //Numpad +
  125.     case (107): return "numpad +"; break;
  126.  
  127.     //Numpad -
  128.     case (109): return "numpad -"; break;
  129.    
  130.     //Numpad .
  131.     case (110): return "numpad ."; break;
  132.    
  133.     //Numpad /
  134.     case (111): return "numpad /"; break;
  135.    
  136.     //F1
  137.     case (112): return "F1"; break;
  138.    
  139.     //F2
  140.     case (113): return "F2"; break;
  141.    
  142.     //F3
  143.     case (114): return "F3"; break;
  144.    
  145.     //F4
  146.     case (115): return "F4"; break;
  147.    
  148.     //F5
  149.     case (116): return "F5"; break;
  150.    
  151.     //F6
  152.     case (117): return "F6"; break;
  153.    
  154.     //F7
  155.     case (118): return "F7"; break;
  156.    
  157.     //F8
  158.     case (119): return "F8"; break;
  159.    
  160.     //F9
  161.     case (120): return "F9"; break;
  162.    
  163.     //F10
  164.     case (121): return "F10"; break;
  165.    
  166.     //F11
  167.     case (122): return "F11"; break;
  168.    
  169.     //F12
  170.     case (123): return "F12"; break;
  171.  
  172.     //Num lock
  173.     case (144): return "num lock"; break;
  174.    
  175.     //Scroll lock
  176.     case (145): return "scroll lock"; break;
  177.  
  178.     //Any key
  179.     default: return chr(argument0); break;
  180. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top