From 45bd2b970b3475bfef05eae00f16dd669ef9af30 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 5 Sep 2026 10:39:54 -0400 Subject: [PATCH] [Bugfix] FS#13975 - Keyremap plugin: text importer allow multiple ACTION_NONE entries importing discards duplicate entries based on context + action code however you may want multiple entries to map to the same action and you can't do it within the same context instead only consider an entry as a duplicate if they have the same context, actioncode, button, and prebutton Change-Id: I5aba3459505987ba37e26758aec62f02fcf8165a --- apps/plugins/keyremap.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/plugins/keyremap.c b/apps/plugins/keyremap.c index 9917bc567e..a224cc292a 100644 --- a/apps/plugins/keyremap.c +++ b/apps/plugins/keyremap.c @@ -746,11 +746,14 @@ static int keymap_add_button_entry(int context, int action_code, for (int i = 0; i < ctx_data.act_count; i++) { if (ctx_data.act_map[i].context == context && - ctx_data.act_map[i].map.action_code == action_code) + ctx_data.act_map[i].map.action_code == action_code && + ctx_data.act_map[i].map.button_code == button_code && + ctx_data.act_map[i].map.pre_button_code == pre_button_code) { - /*Duplicate -- Update the existing entry */ - ctx_data.act_map[i].map.button_code = button_code; - ctx_data.act_map[i].map.pre_button_code = pre_button_code; + /*Duplicate -- Use the existing entry */ + /* FS#13975 allow multiple entries to map same action code */ + logf("keyremap: skipping duplicate @ [%d] ctx: %d, act: %d btn: %d pbtn: %d", + i, context, action_code, button_code, pre_button_code); return ctx_data.act_count; } }