Scan code
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Definition
INT scan_code
Scan_code is defined in the module mod_key and, in contrast to ascii, it contains the last key pressed, not the last character. That means “A” and “a” will have the same scan_code, but different ascii value.
Notes
Take a look at the scancodes for a complete list.
Example
import "mod_text" import "mod_key" import "mod_video" process main() begin set_mode(640,320); write( 0, 60, 10, 0, "Use lower and upper case characters to see the difference"); write( 0, 60, 20, 0, "between ascii and scan_code. (ESC to exit) "); write( 0, 60, 40, 0, "ascii: "); write_var( 0, 110, 40, 0, ascii); write( 0, 26, 50, 0, "scan_code: "); write_var( 0, 110, 50, 0, scan_code); while ( !key(_esc)) frame; end end