From: Toni Wilen Date: Sat, 14 Oct 2017 17:43:31 +0000 (+0300) Subject: Release buttons only when mouse is uncaptured, not when input devices are unacquired. X-Git-Tag: 3600~82 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=994e47a3d6709b711fbb7a11ee0eb71181146ea6;p=francis%2Fwinuae.git Release buttons only when mouse is uncaptured, not when input devices are unacquired. --- diff --git a/include/inputdevice.h b/include/inputdevice.h index 1a9a9ba3..69829308 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -305,6 +305,7 @@ extern void inputdevice_default_prefs (struct uae_prefs *p); extern void inputdevice_acquire (int allmode); extern void inputdevice_unacquire(void); extern void inputdevice_unacquire(bool emulationactive, int inputmask); +extern void inputdevice_releasebuttons(void); extern void indicator_leds (int num, int state); diff --git a/inputdevice.cpp b/inputdevice.cpp index 573f7aa8..7a553d5f 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -5087,7 +5087,7 @@ void inputdevice_reset (void) } lightpen_trigger2 = 0; cubo_flag = 0; - alg_flag = 0; + alg_flag &= 1; } static int getoldport (struct uae_input_device *id) @@ -8355,7 +8355,7 @@ void inputdevice_copy_single_config (struct uae_prefs *p, int src, int dst, int } } -static void clearpressmask(void) +void inputdevice_releasebuttons(void) { for (int i = 0; i < MAX_INPUT_DEVICES; i++) { for (int j = 0; j < 32; j++) { @@ -8402,8 +8402,6 @@ void inputdevice_acquire (int allmode) idev[IDTYPE_KEYBOARD].acquire (i, allmode < 0); } - clearpressmask(); - if (input_acquired) return; @@ -8453,8 +8451,6 @@ void inputdevice_unacquire(bool emulationactive, int inputmask) idev[IDTYPE_MOUSE].unacquire(-1); if (!(inputmask & 1)) idev[IDTYPE_KEYBOARD].unacquire(-1); - - clearpressmask(); } void inputdevice_unacquire(void) @@ -9048,6 +9044,7 @@ void inputdevice_joyport_config_store(struct uae_prefs *p, const TCHAR *value, i } if (mode >= 0) jp->mode = mode; + jp->changed = true; } int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value1, const TCHAR *value2, int portnum, int mode, int type, bool candefault) @@ -9244,11 +9241,16 @@ int inputdevice_getjoyportdevice (int port, int val) void inputdevice_fix_prefs(struct uae_prefs *p, bool userconfig) { struct jport jport_config_store[MAX_JPORTS]; + bool changed = false; for (int i = 0; i < MAX_JPORTS; i++) { memcpy(&jport_config_store[i], &p->jports[i], sizeof(struct jport)); + changed |= p->jports[i].changed; } + if (!changed) + return; + bool defaultports = userconfig == false; // Convert old style custom mapping to new style for (int i = 0; i < MAX_JPORTS_CUSTOM; i++) { diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 3b976c95..925f7e6a 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -845,6 +845,7 @@ static void setmouseactive2 (int active, bool allowpause) } #endif inputdevice_acquire (FALSE); + inputdevice_releasebuttons(); } if (!active && allowpause) { if (currprefs.win32_active_nocapture_pause) {