From b1b768a57786ec43aeab91ae8507db6b0e8224aa Mon Sep 17 00:00:00 2001 From: Brambor Date: Thu, 28 Nov 2024 11:35:31 +0100 Subject: [PATCH] fix: reset keybinding to "Unbound locally!" now works --- src/input_context.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/input_context.cpp b/src/input_context.cpp index 33bf650c6f87e..f932752c1d9d9 100644 --- a/src/input_context.cpp +++ b/src/input_context.cpp @@ -884,6 +884,11 @@ bool input_context::action_reset( const std::string &action_id ) if( iter_action == iter_def->second.end() ) { continue; } + if( iter_action->second.input_events.empty() ) { + // special case: reset to an empty local keybinding "Unbound locally!" + inp_mngr.get_or_create_event_list( action_id, context ); + continue; + } for( const input_event &event : iter_action->second.input_events ) { inp_mngr.add_input_for_action( action_id, context, event ); }