Lemmings Forums

Other Lemmings Projects => SuperLemmix => SuperLemmix Bugs & Suggestions => Topic started by: GigaLem on November 20, 2025, 01:30:39 AM

Title: [✓][BUG][ED] Piece Browser Window ignores Hotkeys
Post by: GigaLem on November 20, 2025, 01:30:39 AM
I've been trying out new versions of the SLX editor for its NL support complete with its QoL features however I came across a couple of bugs in its recent version

Hotkeys not accepted - I have to click on the main editor itself to use hotkeys simply because when I try to use them in the window, nothing happens or it only moves the view point of the level
Title: Re: [BUG] Level Arranger Window ignores Hotkeys & Piece Window Doesn't load pieces
Post by: WillLem on November 20, 2025, 04:52:58 AM
Quote from: GigaLem on November 20, 2025, 01:30:39 AMI have to click on the main editor itself to use hotkeys simply because when I try to use them in the window, nothing happens or it only moves the view point of the level

I haven't been able to replicate this one; both forms have key preview and send events to the main form. It's possible that the individual controls might be eating the key events in some cases, I'll have to look into that. Which window is active when the hotkeys aren't working?

I'm currently thinking that having these pop-outs as separate forms migt not actually be the best way to do it. I'm looking into whether these can be actual widgets which are still part of the main form.
Title: Re: [?][BUG] Level Arranger Window ignores Hotkeys
Post by: WillLem on November 20, 2025, 05:34:31 AM
From Discord:

Quote from: DiscordWill — 5:13 AM
Try this and see if it works:
1) Open a new level and select desired style
2) Open the Level Arranger window and make sure it's in focus
3) Press "1" to add a piece to the level
4) Press "C" to duplicate the piece
5) Press direction arrows to move the piece
What happens?

GigaLem — 5:18 AM
strange, that worked, could there be conflicting hotkeys perhaps

Will — 5:19 AM
Possibly. It could be that certain controls "eat" key inputs and don't pass them to the main form. I've made sure that both Level Arranger and Piece Browser preview keys and pass the events to the main form, but when you have moving parts like this it's very easy for things to go wrong
Best thing you could do to help is please pay attention to exactly what's going on when the problem occurs: is a particular window or control in focus? What was the last thing you clicked with the mouse? Stuff like that helps to narrow things down

GigaLem — 5:22 AM
This time it was the level arranger window and the hot keys worked

Will — 5:22 AM
OK, try this then:
1) Open a new level and select desired style
2) Open the Piece Browser window and make sure it's in focus
3) Press "1" to add a piece to the level
4) Press "C" to duplicate the piece
5) Press direction arrows to move the piece

GigaLem — 5:25 AM
When the piece browser is selected, it did dupe the piece but it also changed the style assuming I was pressing C to type in the style

Will — 5:28 AM
Yeah, I've noticed that as well. I'm thinking that's probably a focus issue

GigaLem — 5:28 AM
Now that I did what you asked, the hot keys work when the arranger window is open. Like before it wasn't working but opening a new level made them and im like...huh?!

Will — 5:29 AM
To be fair, there may well be certain scenarios which cause the hotkeys not to work. Clicking a control might cause that control to be in focus, ad it might be eating the hotkeys. If it happens again, try to remember what was the last thing you clicked, and have a look at which window is in focus
I'll obviously investigate it thoroughly myself as well, but any input you can provide will be helpful
Title: Re: [?][BUG][ED] Level Arranger Window ignores Hotkeys
Post by: WillLem on November 20, 2025, 09:33:43 AM
I'm about 90% sure that the culprit is in fact the new Piece Browser window, which has the styles dropdown embedded. This control can eat hotkeys if recently focused, so I've had to take steps to make sure this doesn't happen (whilst continuing to allow the form to respond to hotkeys in general).

The fix is to essentially mimic what happens with the main editor form itself: we pull focus to/from text-based controls when the mouse is not interacting directly with those controls. I've replicated this behaviour on the Piece Browser form and it seems solid.

I'll get the hotfix out later today.

Fixed in commit 159ca64.