VortexCoyote / leraine-studio

A cross-platform portable open-source VSRG chart editor written in C++ with SFML.
Mozilla Public License 2.0
14 stars 6 forks source link

Fix key being stuck when unfocused and config not load properly during startup. #54

Closed Opposite34 closed 3 years ago

Opposite34 commented 3 years ago

This will resolve #53 as I added a ClearKey function to clear the keyboard holds when window refocuses.

Also add SetConfig function to set the all the configurations (except waveform as that rely on InnerRender) during config loading on startup which fixes #51 .

Not sure how well the code is structured so might need to move things around a bit.

Opposite34 commented 3 years ago

Oh and the name SetConfig was used for the function because naming it LoadConfig might be confusing with the Config.Load boolean. However, feel free to change it as appropriate.

VortexCoyote commented 3 years ago

Looks good! But as you mentioned we should look at refactoring the whole config dynamic and all. But for now I'll merge it since it will at least fix the bugs

UnnamedOrange commented 3 years ago

I'd like to argue that in both Windows 10 and Ubuntu it is possible to scroll on a unfocused window, so #53 hasn't been properly solved, I think. If possible, clearing the key states on losing focus instead of on getting focus is recommended.