Skip to content

Commit

Permalink
Merge pull request #78203 from Brambor/fix-reset-unbound-locally
Browse files Browse the repository at this point in the history
fix: reset keybinding to `Unbound locally!` now works
  • Loading branch information
Night-Pryanik authored Nov 29, 2024
2 parents d1cdd3a + b1b768a commit 2975b6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/input_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit 2975b6f

Please sign in to comment.