Code archives/User Input/Proper Key Names

This code has been declared by its author to be Public Domain code.

Download source code

Proper Key Names by dapsycho2002
Didnt know exactly what title to call this but heres a good description.

What I wanted was a function that would return the proper keyname when a user pressed a key. This was for my game so that the user could map keys to the right functions and would be presented with a proper name instead of the scancode or be limited to A-Z or 0-9.

This little bit of code (about 60 lines) will do exactly that. If you run it and press the Right Alt key it will display the scancode plus the key name (Right Alt).

Hope anyone finds this useful.
Please go here for a v.small 2k download:

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=dapsycho05102002182739&comments=no

Comments

None.

Code Archives Forum