From 406588293ce2bea83bd83b746eb734ed32640946 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 22 Apr 2025 22:38:16 +0200 Subject: [PATCH] Load key bind defaults before loading the config, fixes saved key binds across emulator closures and reopenings. --- src/86box.c | 15 +++++++-------- src/config.c | 54 ++++++++++++++++++++++++---------------------------- 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/src/86box.c b/src/86box.c index cde98f5d8..57abb12a6 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1000,6 +1000,13 @@ usage: zip_global_init(); mo_global_init(); + /* Initialize the keyboard accelerator list with default values */ + for (int x = 0; x < NUM_ACCELS; x++) { + strcpy(acc_keys[x].name, def_acc_keys[x].name); + strcpy(acc_keys[x].desc, def_acc_keys[x].desc); + strcpy(acc_keys[x].seq, def_acc_keys[x].seq); + } + /* Load the configuration file. */ config_load(); @@ -1030,14 +1037,6 @@ usage: gdbstub_init(); - // Initialize the keyboard accelerator list with default values - for(int x=0;x