Author Topic: [SUG] Using keyboard keys to control in-game dialogs  (Read 680 times)

0 Members and 1 Guest are viewing this topic.

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
[SUG] Using keyboard keys to control in-game dialogs
« on: May 02, 2023, 03:21:28 PM »
Quote from: mobius, from Discord
it's a minor complaint but it'd be nice if the menus like level selection, replay selector, settings etc; went away with ESC. This is expected behavior with most standard windows applications.  Of course it'd be nice if regular NeoLemmix also had this but I never mentioned this until now, that I remember

Yes, good idea. I'll get this sorted.

I'll aim to make it so [Enter] is OK, and [Esc] is Cancel/Close, where appropriate.
« Last Edit: May 03, 2023, 12:54:58 AM by WillLem »

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Using keyboard keys to control in-game dialogs
« Reply #1 on: May 03, 2023, 01:01:33 AM »
All forms now close when [Esc] is pressed, and - in most cases - cancel any changes made.

The only form I'm having trouble with is Hotkey Config, which has always had a single "Close" button which saves the changes made and closes the form. There is currently no function for cancelling any changes made, since the form has no function to temporarily save whatever config is loaded when the form is opened. It can only save any changes made or load a set of pre-configured hotkeys. This is something I want to look at updating, since it feels like it should be possible to cancel down to whatever the hotkey settings were when the form was first opened - see this topic for progress on this.

Also, [Enter] has always automatically 'pressed' whatever button is currently selected. So, it's already possible to [Tab] to whatever button you want to press, then hit [Enter] to press it. What I have done, though, is improve the TabOrder of the Level Select screen, since it defaults to 'Save Image' as the first button highlighted, which seems a bit wonky. It now defaults to 'Play', which is better, but the TreeView doesn't respond to [Enter] - so, when a level is selected, hitting Enter does nothing - I feel like it should load the level, so I'll look at getting this sorted as well.

I also want to be able to scroll through level previews using the arrow keys (in the Treeview) - currently, it's necessary to click the level to see the preview, which is no good.

So, ideally, I'll want to get these things sorted as well before rolling out this feature.
« Last Edit: May 04, 2023, 12:52:46 AM by WillLem »

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Using keyboard keys to control in-game dialogs
« Reply #2 on: May 04, 2023, 12:53:17 AM »
All done!

:tal-gold: Esc key now closes all forms - Implemented in Commit 0b5951da6
:tal-gold: Level Select Treeview loads level info preview when browsing using the arrow keys - Implemented in Commit bda5e8553
:tal-gold: Level Select Treeview responds to [Enter] key by loading the selected level/pack into the player - Implemented in Commit 3160e24