CHR2#()

Updated Oct. 10, 2005.

WORK IN PROGRESS.

INP(96) reads the keyboard buffer.
INP(96) tells us the keyboard scan code of a character that is pressed. If no key is pressed, it gives us another keyboard scan code that tells us which key was pressed last. Thus, there are two different codes for each key:
The code when it is pressed.
The code after it is pressed.

The following strings give a reference list to the keyboard buffer.

Example use:


DO
LOCATE 1, 1: PRINT chr2$(INP(96))
IF chr2$(INP(96) = "esc" THEN EXIT DO
LOOP


Add 83 if upper case is active.

Notice: 14 and 97 are incorrectly referenced as LEFT in the QB Help, but these are actually BACKSPACE.


DIM SHARED chr2$(1 to 166)

chr2$(1) = "ESC"
chr2$(2) = "1"
chr2$(3) = "2"
chr2$(4) = "3"
chr2$(5) = "4"
chr2$(6) = "5"
chr2$(7) = "6"
chr2$(8) = "7"
chr2$(9) = "8"
chr2$(10) = "9"
chr2$(11) = "10"
chr2$(12) = "-"
chr2$(13) = "="
chr2$(14) = "BACKSPACE"
chr2$(15) = "TAB"
chr2$(16) = "q"
chr2$(17) = "w"
chr2$(18) = "e"
chr2$(19) = "r"
chr2$(20) = "t"
chr2$(21) = "y"
chr2$(22) = "u"
chr2$(23) = "i"
chr2$(24) = "o"
chr2$(25) = "p"
chr2$(26) = "["
chr2$(27) = "]"
chr2$(28) = "ENTER"
chr2$(29) = "CTRL"
chr2$(30) = "a"
chr2$(31) = "s"
chr2$(32) = "d"
chr2$(33) = "f"
chr2$(34) = "g"
chr2$(35) = "h"
chr2$(36) = "j"
chr2$(37) = "k"
chr2$(38) = "l"
chr2$(39) = ";"
chr2$(40) = "'"
chr2$(41) = "`"
chr2$(42) = "LEFT SHIFT"
chr2$(43) = "\"
chr2$(44) = "z"
chr2$(45) = "x"
chr2$(46) = "c"
chr2$(47) = "v"
chr2$(48) = "b"
chr2$(49) = "n"
chr2$(50) = "m"
chr2$(51) = ","
chr2$(52) = "."
chr2$(53) = "/"
chr2$(54) = "RIGHT SHIFT"
chr2$(55) = "*", possibly "PRINT SCREEN"
chr2$(56) = "ALT"
chr2$(57) = "SPACEBAR"
chr2$(58) = "CAPSLOCK"
chr2$(59) = "F1"
chr2$(60) = "F2"
chr2$(61) = "F3"
chr2$(62) = "F4"
chr2$(63) = "F5"
chr2$(64) = "F6"
chr2$(65) = "F7"
chr2$(66) = "F8"
chr2$(67) = "F9"
chr2$(68) = "F10"
chr2$(69) = "NUMLOCK"
chr2$(70) = "SCROLL LOCK"
chr2$(71) = "7"
chr2$(72) = "8"
chr2$(73) = "9"
chr2$(74) = "-"
chr2$(75) = "4"
chr2$(76) = "5"
chr2$(77) = "6"
chr2$(78) = "+"
chr2$(79) = "1"
chr2$(80) = "2"
chr2$(81) = "3"
chr2$(82) = "0"

chr2$(83) = "."
chr2$(84) = "ESC"
chr2$(85) = "!"
chr2$(86) = "@"
chr2$(87) = "#"
chr2$(88) = "$"
chr2$(89) = "%"
chr2$(90) = "^"
chr2$(90) = "&"
chr2$(91) = "("
chr2$(92) = ")"
chr2$(93) = "10"
chr2$(94) = "_"
chr2$(95) = "+"
chr2$(97) = "BACKSPACE"
chr2$(98) = "TAB"
chr2$(99) = "Q"
chr2$(100) = "W"
chr2$(101) = "E"
chr2$(102) = "R"
chr2$(103) = "T"
chr2$(104) = "Y"
chr2$(105) = "U"
chr2$(106) = "I"
chr2$(107) = "O"
chr2$(108) = "P"
chr2$(109) = "{"
chr2$(110) = "}"
chr2$(111) = "ENTER"
chr2$(112) = "CTRL"
chr2$(113) = "A"
chr2$(114) = "S"
chr2$(115) = "D"
chr2$(116) = "F"
chr2$(117) = "G"
chr2$(118) = "H"
chr2$(119) = "J"
chr2$(120) = "K"
chr2$(121) = "L"
chr2$(122) = ":"
chr2$(123) = CHR$(34) 'it's a "
chr2$(124) = "~"
chr2$(125) = "LEFT SHIFT"
chr2$(126) = "|"
chr2$(127) = "Z"
chr2$(128) = "X"
chr2$(129) = "C"
chr2$(130) = "V"
chr2$(131) = "B"
chr2$(132) = "N"
chr2$(133) = "M"
chr2$(134) = "<"
chr2$(135) = ">"
chr2$(136) = "?"
chr2$(137) = "RIGHT SHIFT"
chr2$(138) = "*"
chr2$(139) = "ALT"
chr2$(140) = "SPACEBAR"
chr2$(141) = "CAPSLOCK"
chr2$(142) = "F1"
chr2$(143) = "F2"
chr2$(144) = "F3"
chr2$(145) = "F4"
chr2$(146) = "F5"
chr2$(147) = "F6"
chr2$(148) = "F7"
chr2$(149) = "F8"
chr2$(150) = "F9"
chr2$(151) = "F10"
chr2$(152) = "NUMLOCK"
chr2$(153) = "SCROLL LOCK"
chr2$(154) = "HOME"
chr2$(155) = "UP"
chr2$(156) = "PGUP"
chr2$(157) = "-"
chr2$(158) = "LEFT"
chr2$(159) = "5"
chr2$(160) = "RIGHT"
chr2$(161) = "+"
chr2$(162) = "END"
chr2$(163) = "DOWN"
chr2$(164) = "PGDN"
chr2$(165) = "INS"
chr2$(166) = "DEL"


ChrTwo - page last edited 2005-10-10 10:43:32 by 24.128.143.175 (home) (edit)
Blast WIKI - by RoboticBoy - edited and tweaked for our evil purposes by Hexadecimal Disaster