mirror of https://github.com/PCSX2/pcsx2.git
gui: kb shortcuts: yet another fix for the ini parser
Apparently I logged the values incorrectly previously. I said that shift-q gets parsed as Q without shift, but actually the shift flag is set correctly on such case (though the letter is still upper case for shift-q and it's still lower case for plain q) So I retested all the 8 modifiers combination, and noticed that the modifiers are always parsed and set correctly, but the letter ends up upper case if any modifiers are used, but lower case if no modifiers are used. We still need to make lower if it's upper, but don't need to add the shift flag.
This commit is contained in:
parent
efeb66c852
commit
69a978fe05
|
@ -614,12 +614,11 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& _acode, const char *s
|
|||
// Note that this needs to match the key event codes at Pcsx2App::PadKeyDispatch
|
||||
// Our canonical representation is the char code (at lower case if
|
||||
// applicable) with a separate modifier indicator, including shift.
|
||||
// The parser deviates from this by parsing e.g. `shift-q` as 81 (Q) without shift, instead of 113 (q) with shift.
|
||||
// (For plain `q` it does end up correctly with 113).
|
||||
// The parser works correctly for symbols, e.g. `-` ends up as 45
|
||||
// So we only need to change upper case letters to lower case and add the shift flag.
|
||||
// The parser deviates from this by setting the keycode to upper case if
|
||||
// modifiers are used with plain letters. Luckily, it sets the modifiers
|
||||
// correctly, including shift (for letters without modifiers it parses lower case).
|
||||
// So we only need to change upper case letters to lower case.
|
||||
acode.keycode += 'a' - 'A';
|
||||
acode.Shift();
|
||||
}
|
||||
if (_acode.ToString() != acode.ToString()) {
|
||||
Console.WriteLn(Color_StrongGreen, L"Overriding '%s': assigning %s (instead of %s)",
|
||||
|
|
Loading…
Reference in New Issue