From 15104475a193257a5f79c2e59047be80367dc773 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 12 Oct 2023 05:16:37 +0200 Subject: [PATCH] Added --keycodes / -K to allow redefining the mouse uncapture key combination. --- src/86box.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/86box.c b/src/86box.c index 320eda721..7ff4ff4c7 100644 --- a/src/86box.c +++ b/src/86box.c @@ -525,6 +525,7 @@ usage: #ifdef USE_INSTRUMENT printf("-J or --instrument name - set 'name' to be the profiling instrument\n"); #endif + printf("-K or --keycodes codes - set 'codes' to be the uncapture combination\n"); printf("-L or --logfile path - set 'path' to be the logfile\n"); printf("-M or --dumpmissing - dump missing machines and video cards\n"); printf("-N or --noconfirm - do not ask for confirmation on quit\n"); @@ -610,6 +611,13 @@ usage: clear_flash = 1; } else if (!strcasecmp(argv[c], "--clearnvr") || !strcasecmp(argv[c], "-Q")) { clear_cmos = 1; + } else if (!strcasecmp(argv[c], "--keycodes") || !strcasecmp(argv[c], "-K")) { + if ((c + 1) == argc) + goto usage; + + sscanf(argv[++c], "%03hX,%03hX,%03hX,%03hX,%03hX,%03hX", + &key_prefix_1_1, &key_prefix_1_2, &key_prefix_2_1, &key_prefix_2_2, + &key_uncapture_1, &key_uncapture_2); } else if (!strcasecmp(argv[c], "--clearboth") || !strcasecmp(argv[c], "-X")) { clear_cmos = 1; clear_flash = 1;