Pressing Enter/Return key to Save game [SOLVED]

Started by shaun9991, Fri 25/03/2022 19:42:33

Previous topic - Next topic

shaun9991

Hi there,

Apologies for all the questions recently!

I'm looking to implement a little "ease of life" feature into my game - once the player has typed the name of their Save game, it will be cool if they could just press the Enter/Return key for the game to save and the Save gui to close (rather than having to then click the "Save" button with the mouse after they've typed it) . Is there a way of doing this? I've tried a few things but nothing has worked so far.

I have a very standard set up for the save system, as seen here: https://www.adventuregamestudio.co.uk/wiki/Creating_Custom_Save_and_Load_Dialogs

Any suggestions are greatly appreciated :)

Many thanks,
Shaun
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

eri0o

If they select the previous save, doesn't it overwrite the previous and it works?

Crimson Wizard

Quote from: shaun9991 on Fri 25/03/2022 19:42:33
I'm looking to implement a little "ease of life" feature into my game - once the player has typed the name of their Save game, it will be cool if they could just press the Enter/Return key for the game to save and the Save gui to close (rather than having to then click the "Save" button with the mouse after they've typed it)

The text box control has OnActivate event which is called when player presses enter; add a function for that event and call Save button's handler from there.

shaun9991

Thanks CW! That works perfectly :)

I completely missed the OnActivate event!
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

SMF spam blocked by CleanTalk