https://wiki.bennugd.org/index.php?title=Scan_code&feed=atom&action=historyScan code - Revision history2024-03-29T01:44:35ZRevision history for this page on the wikiMediaWiki 1.36.2https://wiki.bennugd.org/index.php?title=Scan_code&diff=18874&oldid=prevKloppix at 14:28, 27 October 20142014-10-27T14:28:45Z<p></p>
<p><b>New page</b></p><div>[[category:variables]]<br />
[[category:predefined]]<br />
[[category:global variables]]<br />
[[category:mod_key]]<br />
<br />
[[Global variables|'''Up to Global Variables''']]<br />
<br />
----<br />
<br />
== Definition ==<br />
'''INT''' scan_code<br />
<br />
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.<br />
<br />
== Notes ==<br />
Take a look at the [[scancodes]] for a complete list.<br />
<br />
== Example ==<br />
<br />
<pre><br />
import "mod_text"<br />
import "mod_key"<br />
import "mod_video"<br />
<br />
process main()<br />
begin<br />
set_mode(640,320);<br />
<br />
write( 0, 60, 10, 0, "Use lower and upper case characters to see the difference");<br />
write( 0, 60, 20, 0, "between ascii and scan_code. (ESC to exit) ");<br />
<br />
write( 0, 60, 40, 0, "ascii: ");<br />
write_var( 0, 110, 40, 0, ascii);<br />
<br />
write( 0, 26, 50, 0, "scan_code: ");<br />
write_var( 0, 110, 50, 0, scan_code);<br />
<br />
while ( !key(_esc))<br />
frame;<br />
end<br />
end <br />
</pre><br />
<br />
{{Globals}}</div>Kloppix