A downloadable asset pack

Download NowName your own price

For  GameMaker Studio 2.3 and above

This extension makes fetching the user's keyboard layout in GameMaker possible! (QWERTY, QWERTZAZERTY)

⚠️This only works for Windows exports as far as I know⚠️
(It might work for Linux and/or macOS, but I cannot test on those platforms)

⌨️Adds a new function!⌨️

  • keyboard_get_layout(global_variable_string)

Takes a global variable name (string) as a mandatory argument. The global variable does not need to have been created beforehand.
If the global variable given does not exist, the script will automatically create it for you.

The result is then stored into the given global variable, which can be the following:

  • noone, the layout is still being fetched.
  • "QWERTY"
  • "QWERTZ"
  • "AZERTY"

⚙️Example Use⚙️

/// CREATE EVENT ///
keyboard_get_layout("global.keyboard_layout");
/// STEP EVENT ///
if global.keyboard_layout != noone 
{
    show_message(global.keyboard_layout);
}

📁How to Install📁

Download the provided keyboard_get_layout.yymps file, then drag and drop it onto your opened GameMaker project.
Simply click "Add All" then "Import" to finish importing the Asset Package, and you're done!

The Package includes the following:

- [Keyboard Layout Fetcher]     //Folder
    - keyboard_get_layout       //Script
    - oKeyboardLayoutFetcher    //Object

🗒️Notes🗒️

It's definitely a bit hacky, but it works!
Unfortunately, due to the way inputs work inside of GameMaker, there is - to my knowledge - no way to do this in a single frame, hence the use of an object.

The font used in the cover image is Monogram by datagoblin
https://datagoblin.itch.io/monogram

Published 6 days ago
StatusReleased
CategoryAssets
AuthorChlofie
TagsGameMaker, keyboard, layout

Download

Download NowName your own price

Click download now to get access to the following files:

keyboard_get_layout.yymps 4.6 kB

Leave a comment

Log in with itch.io to leave a comment.