KBTester for GameMaker
A downloadable tool for Windows, Mac OS X, Linux, and Android
A simple, quick and dirty utility to help you with getting the values GameMaker sees when a keyboard key is pressed.
Run the project, press a key on the keyboard. The keyboard's numeric code and character (if any) will be displayed.
Left-click the mouse to clear, or press a new key to get another value.
Why would you need this?
GML provides two ways to feed an argument to its keyboard_check() functions: a series of virtual keyboard constants (vk_*) for most of the special keys, or the ord() function for letter and number keys.
The problem is that for some reason, GML doesn't have vk_ constants for the entire keyboard. What's more, the ord(char) function doesn't always work if you provide the char that you see on the key you intend to check for.
I discovered this when I wanted to use the period key (".") to control my game. There's no vk_period constant in GML, and ord(".") didn't work. This lead me down a rabbit hole to map out all the keys on my keyboard and determine the values that GameMaker sees when each and every key is pressed. Eventually I realized a need for a utility that I could use to quickly check. GameMaker's helpfile warns that you shouldn't provide a numeric code to the ord() function, because these codes can vary and should not be relied upon. Different keyboard layouts, localizations, and devices may return different values for the same key, so having utility to check this on your desired platform is useful.
Click download now to get access to the following files:
Leave a comment
Log in with your itch.io account to leave a comment.