From: Toni Wilen Date: Mon, 26 Oct 2015 16:48:10 +0000 (+0200) Subject: Fix off-by-one keyboard layout after input re-enumeration. X-Git-Tag: 3200~12 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=84353d78f70805483de7bcd99c5ee1e53b3941f8;p=francis%2Fwinuae.git Fix off-by-one keyboard layout after input re-enumeration. --- diff --git a/inputdevice.cpp b/inputdevice.cpp index b1700ff2..dbe663b8 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -5567,7 +5567,7 @@ static void matchdevices (struct inputdevice_functions *inf, struct uae_input_de } else if (p1 && p2 && p1 - bname == p2 - bname2) { *p1 = 0; *p2 = 0; - if (bname && !_tcscmp (bname2, bname)) + if (bname[0] && !_tcscmp (bname2, bname)) matched = true; } if (matched) { @@ -5842,7 +5842,7 @@ void inputdevice_devicechange (struct uae_prefs *prefs) } } else if (jportskb[i] >= 0) { TCHAR tmp[10]; - _stprintf (tmp, _T("kbd%d"), jportskb[i]); + _stprintf (tmp, _T("kbd%d"), jportskb[i] + 1); inputdevice_joyport_config (prefs, tmp, i, jportsmode[i], 0, true); } prefs->jports[i].autofire = jportaf[i];