TGC Codebase Backup



KeyScanner by Anonymous Coder

20th Mar 2004 9:40
Summary

Very simple utility for returning the scancode of any key pressed.



Description

Hadn't seen anything similar in the codebase and thought this may be useful to newbies like myself. Very short piece of code, which very simply returns the scancode associated with any key on the keyboard. Exit by pressing the spacebar.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem # Title:       KeyScanner
rem # Author:      John Macdonald
rem # Date:        20 March 2004
rem # Description: This short program will print the scancode 
rem #              of the keypressed to the screen.

repeat
cls
print "Press Spacebar to exit"
print scancode()
until scancode() = 57