November 28, 2020, 11:06:18 AM

Author Topic: [bb] Redefine key return function by * [ 1+ years ago ]  (Read 515 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Redefine key return function by * [ 1+ years ago ]
« on: June 29, 2017, 12:28:41 AM »
Title : Redefine key return function
Author : *
Posted : 1+ years ago

Description : Example:

Print key$ = WhatIsKey$( 1 )

would print:
Escape


Code :
Code: BlitzBasic
  1. Function WhatisKey$( key )
  2.         ;this gives the actual key as it is on the keyboard
  3.         Select key
  4.         Case 0  :Return "Unbound"
  5.         Case 1  :Return "Escape"
  6.         Case 2  :Return "1"
  7.         Case 3  :Return "2"
  8.         Case 4  :Return "3"
  9.         Case 5  :Return "4"
  10.         Case 6  :Return "5"
  11.         Case 7  :Return "6"
  12.         Case 8  :Return "7"
  13.         Case 9  :Return "8"
  14.         Case 10 :Return "9"
  15.         Case 11 :Return "0"
  16.         Case 12 :Return "-"
  17.         Case 13 :Return "="
  18.         Case 14 :Return "Backspace"
  19.         Case 15 :Return "Tab"
  20.         Case 16 :Return "Q"
  21.         Case 17 :Return "W"
  22.         Case 18 :Return "E"
  23.         Case 19 :Return "R"
  24.         Case 20 :Return "T"
  25.         Case 21 :Return "Y"
  26.         Case 22 :Return "U"
  27.         Case 23 :Return "I"
  28.         Case 24 :Return "O"
  29.         Case 25 :Return "P"
  30.         Case 26 :Return "["
  31.         Case 27 :Return "]"
  32.         Case 28 :Return "Enter/Return"
  33.         Case 29 :Return "Left CTRL"
  34.         Case 30 :Return "A"
  35.         Case 31 :Return "S"
  36.         Case 32 :Return "D"
  37.         Case 33 :Return "F"
  38.         Case 34 :Return "G"
  39.         Case 35 :Return "H"
  40.         Case 36 :Return "J"
  41.         Case 37 :Return "K"
  42.         Case 38 :Return "L"
  43.         Case 39 :Return ";"
  44.         Case 40 :Return "'"
  45.         Case 41 :Return "`"
  46.         Case 42 :Return "Left Shift"
  47.         Case 43 :Return ""
  48.         Case 44 :Return "Z"
  49.         Case 45 :Return "X"
  50.         Case 46 :Return "C"
  51.         Case 47 :Return "V"
  52.         Case 48 :Return "B"
  53.         Case 49 :Return "N"
  54.         Case 50 :Return "M"
  55.         Case 51 :Return ","
  56.         Case 52 :Return "."
  57.         Case 53 :Return "/"
  58.         Case 54 :Return "Right Shift"
  59.         Case 55 :Return "Keypad *"
  60.         Case 56 :Return "Left Alt"
  61.         Case 57 :Return "Space"
  62.         Case 58 :Return "Caps Lock"
  63.         Case 59 :Return "F1"
  64.         Case 60 :Return "F2"
  65.         Case 61 :Return "F3"
  66.         Case 62 :Return "F4"
  67.         Case 63 :Return "F5"
  68.         Case 64 :Return "F6"
  69.         Case 65 :Return "F7"
  70.         Case 66 :Return "F8"
  71.         Case 67 :Return "F9"
  72.         Case 68 :Return "F10"
  73.         Case 69 :Return "Num Lock"
  74.         Case 70 :Return "Scroll Lock"
  75.         Case 71 :Return "Numpad 7"
  76.         Case 72 :Return "Numpad 8"
  77.         Case 73 :Return "Numpad 9"
  78.         Case 74 :Return "Numpad -"
  79.         Case 75 :Return "Numpad 4"
  80.         Case 76 :Return "Numpad 5"
  81.         Case 77 :Return "Numpad 6"
  82.         Case 78 :Return "Numpad +"
  83.         Case 79 :Return "Numpad 1"
  84.         Case 80 :Return "Numpad 2"
  85.         Case 81 :Return "Numpad 3"
  86.         Case 82 :Return "Numpad 0"
  87.         Case 83 :Return "Numpad ."
  88.         Case 84 :Return "?"
  89.         Case 85 :Return "?"
  90.         Case 86 :Return "OEM 102"
  91.         Case 87 :Return "F11"
  92.         Case 88 :Return "F12"
  93.         Case 89 :Return "?"
  94.         Case 90 :Return "?"
  95.         Case 91 :Return "?"
  96.         Case 92 :Return "?"
  97.         Case 93 :Return "?"
  98.         Case 94 :Return "?"
  99.         Case 95 :Return "?"
  100.         Case 96 :Return "?"
  101.         Case 97 :Return "?"
  102.         Case 98 :Return "?"
  103.         Case 99 :Return "?"
  104.         Case 100:Return "F13"
  105.         Case 101:Return "F14"
  106.         Case 102:Return "F15"
  107.         Case 103:Return "?"
  108.         Case 104:Return "?"
  109.         Case 105:Return "?"
  110.         Case 106:Return "?"
  111.         Case 107:Return "?"
  112.         Case 108:Return "?"
  113.         Case 109:Return "?"
  114.         Case 110:Return "?"
  115.         Case 111:Return "?"
  116.         Case 112:Return "Kana"
  117.         Case 113:Return "?"
  118.         Case 114:Return "?"
  119.         Case 115:Return "ABNT C1"
  120.         Case 116:Return "?"
  121.         Case 117:Return "?"
  122.         Case 118:Return "?"
  123.         Case 119:Return "?"
  124.         Case 120:Return "?"
  125.         Case 121:Return "Convert"
  126.         Case 122:Return "?"
  127.         Case 123:Return "NoConvert"
  128.         Case 124:Return "?"
  129.         Case 125:Return "Yen"
  130.         Case 126:Return "ABNT C2"
  131.         Case 127:Return "?"
  132.         Case 128:Return "?"
  133.         Case 129:Return "?"
  134.         Case 130:Return "?"
  135.         Case 131:Return "?"
  136.         Case 132:Return "?"
  137.         Case 133:Return "?"
  138.         Case 134:Return "?"
  139.         Case 135:Return "?"
  140.         Case 136:Return "?"
  141.         Case 137:Return "?"
  142.         Case 138:Return "?"
  143.         Case 139:Return "?"
  144.         Case 140:Return "?"
  145.         Case 141:Return "Keypad ="
  146.         Case 142:Return "?"
  147.         Case 143:Return "?"
  148.         Case 144:Return "Prev Track"
  149.         Case 145:Return "AT"
  150.         Case 146:Return ":"
  151.         Case 147:Return "Underline"
  152.         Case 148:Return "Kanji"
  153.         Case 149:Return "Stop"
  154.         Case 150:Return "AX"
  155.         Case 151:Return "Unlabeled"
  156.         Case 152:Return "?"
  157.         Case 153:Return "Next Track"
  158.         Case 154:Return "?"
  159.         Case 155:Return "?"
  160.         Case 156:Return "Keypad Enter"
  161.         Case 157:Return "Right CTRL"
  162.         Case 158:Return "?"
  163.         Case 159:Return "?"
  164.         Case 160:Return "Mute"
  165.         Case 161:Return "Calculator"
  166.         Case 162:Return "Play/Pause"
  167.         Case 163:Return "?"
  168.         Case 164:Return "Media Stop"
  169.         Case 165:Return "?"
  170.         Case 166:Return "?"
  171.         Case 167:Return "?"
  172.         Case 168:Return "?"
  173.         Case 169:Return "?"
  174.         Case 170:Return "?"
  175.         Case 171:Return "?"
  176.         Case 172:Return "?"
  177.         Case 173:Return "?"
  178.         Case 174:Return "Volume Down"
  179.         Case 175:Return "?"
  180.         Case 176:Return "Volume Up"
  181.         Case 177:Return "?"
  182.         Case 178:Return "Web Home"
  183.         Case 179:Return "Keypad ,"
  184.         Case 180:Return "?"
  185.         Case 181:Return "Keypad /"
  186.         Case 182:Return "?"
  187.         Case 183:Return "System Request"
  188.         Case 184:Return "Right Alt"
  189.         Case 185:Return "?"
  190.         Case 186:Return "?"
  191.         Case 187:Return "?"
  192.         Case 188:Return "?"
  193.         Case 189:Return "?"
  194.         Case 190:Return "?"
  195.         Case 191:Return "?"
  196.         Case 192:Return "?"
  197.         Case 193:Return "?"
  198.         Case 194:Return "?"
  199.         Case 195:Return "?"
  200.         Case 196:Return "?"
  201.         Case 197:Return "Pause"
  202.         Case 198:Return "?"
  203.         Case 199:Return "Home"
  204.         Case 200:Return "Cursor Up"
  205.         Case 201:Return "Page Up"
  206.         Case 202:Return "?"
  207.         Case 203:Return "Cursor Left"
  208.         Case 204:Return "?"
  209.         Case 205:Return "Cursor Right"
  210.         Case 206:Return "?"
  211.         Case 207:Return "End"
  212.         Case 208:Return "Cursor Down"
  213.         Case 209:Return "Page Down"
  214.         Case 210:Return "Insert"
  215.         Case 211:Return "Delete"
  216.         Case 212:Return "?"
  217.         Case 213:Return "?"
  218.         Case 214:Return "?"
  219.         Case 215:Return "?"
  220.         Case 216:Return "?"
  221.         Case 217:Return "?"
  222.         Case 218:Return "?"
  223.         Case 219:Return "Left Windows Key"
  224.         Case 220:Return "Right Windows Key"
  225.         Case 221:Return "Windows Menu Key"
  226.         Case 222:Return "Power"
  227.         Case 223:Return "Sleep"
  228.         Case 224:Return "?"
  229.         Case 225:Return "?"
  230.         Case 226:Return "?"
  231.         Case 227:Return "Wake"
  232.         Case 228:Return "?"
  233.         Case 229:Return "Web Search"
  234.         Case 230:Return "Favorites"
  235.         Case 231:Return "Web Refresh"
  236.         Case 232:Return "Web Stop"
  237.         Case 233:Return "Web Forward"
  238.         Case 234:Return "Web Back"
  239.         Case 235:Return "My Computer"
  240.         Case 236:Return "Mail"
  241.         Case 237:Return "Media Select"
  242.         Case 238:Return "?"
  243.         Case 239:Return "?"
  244.         Case 240:Return "?"
  245.         Case 241:Return "?"
  246.         Case 242:Return "?"
  247.         Case 243:Return "?"
  248.         Case 244:Return "?"
  249.         Case 245:Return "?"
  250.         Case 246:Return "?"
  251.         Case 247:Return "?"
  252.         Case 248:Return "?"
  253.         Case 249:Return "?"
  254.         Case 250:Return "?"
  255.         Case 251:Return "?"
  256.         Case 252:Return "?"
  257.         Case 253:Return "?"
  258.         Case 254:Return "?"
  259.         Case 255:Return "?"
  260.         End Select
  261. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal