Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
0
Members

Get input key name

A topic by 3m0 created Nov 21, 2019 Views: 286 Replies: 2
Viewing posts 1 to 3

Hello, I've read the documentation on Sup.Input and found out that I can check which key was pressed, but is there a way to get the key name on Input?

Picture the following scenario for example:

The game has an options menu which allows the player to change the controls. When the player presses a key, the key is saved in local storage.


Is there a way to get the key name without having to compare them one by one?

(1 edit) (+1)

Hi !

I think a way to do that is with  

getTextEntered(): string;
getGamepadButtonValue(gamepad: number, button: number): number;

Here the solution (even after 272 days late):

https://itch.io/t/931471/clear-command-selection#post-1885419