Add KeyBindingsChanged callin#3081
Open
burnhamrobertp wants to merge 2 commits into
Open
Conversation
Collaborator
|
Co-authored-by: Amadeus Folego <amadeusfolego@gmail.com>
1cfa2e3 to
3d6ac7a
Compare
Contributor
Author
|
Squashed into the two commits. Good catch on the widget handler, it was missing there. I wired it the same way KeyMapChanged is (into the callin list, a I ran the engine side in a small game to check it fires once on a single bind/unbind, once rather than per line on keyreload and unbindall, and not at all on keydebug. |
sprunk
reviewed
Jul 1, 2026
3d6ac7a to
d8dca15
Compare
sprunk
approved these changes
Jul 1, 2026
badosu
reviewed
Jul 2, 2026
badosu
reviewed
Jul 2, 2026
d8dca15 to
1c23ffa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviving #2575, which stalled after review. Implements #2519. Built on Phireh's commits (kept as-is so the credit stays with them) with a couple of follow-ups from me for the review feedback.
Main change from #2575: the callin no longer passes anything. Per sprunk's point on the original PR, locking in a payload format seemed premature, and anything a listener needs is already available through
Spring.GetKeyBindings. SoKeyBindingsChanged()just fires as a signal and listeners re-read if they care. That also drops the half-finished table-building code that was in there.Smaller things: the inline
{}stub in EventClient.h is now a plain declaration with an empty definition in EventClient.cpp, matching the other callins in that section (badosu asked about the braces). The leftover@returnand the typo sprunk flagged are gone with the removed block. Kept Phireh'ssendEventsbatching so keyreload/keyload/unbindall fire a single event instead of one per line.I left
buildHotkeyMapalone for now. badosu noted it isn't set on some mutating ops (e.g. unbindaction) and overlaps with thechangedKeysflag, but reworking it looked bigger than this PR, and now that the payload is empty an occasional redundant event is harmless since listeners just re-read. Probably better as a separate follow-up. Right now only keydebug skips the event, and commands that fail already early-return before the emit.Builds clean for both legacy and headless, and I ran it in a small game: KeyBindingsChanged fires once for a single bind and once for a single unbind, fires exactly once for keyreload and unbindall (not once per line), and doesn't fire at all for keydebug. @badosu does this match the direction you wanted? There's a keybind editor being built in BAR that would consume this, and it only needs the plain signal form.
Used Claude to help with the rework.