<p></p>
<p dir="auto">Refiling this issue to start afresh, replacing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="581253626" data-permission-text="Title is private" data-url="https://github.com/ohrrpgce/ohrrpgce/issues/785" data-hovercard-type="issue" data-hovercard-url="/ohrrpgce/ohrrpgce/issues/785/hovercard" href="https://github.com/ohrrpgce/ohrrpgce/issues/785">#785</a> which is entirely obsolete and irrelevant discussion.</p>
<p dir="auto">Although text entry should work, key mapping for key combos can still be quite broken. A specific example is pressing + to e.g. add a slice or a map layer: on a German keyboard using gfx_sdl2 you have to press the ยด key (left of backspace, where + is on a US keyboard), or press numpad +.</p>
<p dir="auto">Aside from mappings, we also make incorrect assumptions about which symbols share keys or not. The < > [ ] { } , . keys are the biggest problems. E.g. on a German keyboard < and > are on the same key, a key that doesn't even exist on a US keyboard! So if we respected the actual keycaps for the user's layout they might have to press Shift/Alt/Fn to access some keys. That's a change we might want to make just in Custom, not Game. Although I'd struggle to find any games that'd be affected. Maybe a couple of roguelikes that use the ? key?</p>
<p dir="auto">The ability for users to remap controls in Custom would be very nice and would let people replace awkward controls like having to press <code class="notranslate">Shift-<</code> to input <code class="notranslate">></code> to e.g. change palette colour, but that's a separate feature. Key combos should just work, pressing Shift/Alt/Fn as needed, without having to remap anything.</p>
<p dir="auto">Part of this problem is gfx_sdl2 specific (I haven't tested the others yet): gfx_sdl uses the key-symbol-based <code class="notranslate">SDLKey</code> while gfx_sdl2 uses the key-location-based <code class="notranslate">SDL_Scancode</code>, and I don't remember why I made that change, maybe because I thought it was closer to the behaviour of QB and FB or maybe because it caused mapping problems when holding Shift? It's likely gfx_sdl2 should switch to using <code class="notranslate">SDL_Keycode</code> but doing so might break other things.</p>
<p dir="auto">SDL2's <code class="notranslate">SDL_keysym</code> included in key events provides the <a href="https://wiki.libsdl.org/SDL2/SDL_Scancode" rel="nofollow">SDL_Scancode</a> (<code class="notranslate">SDL_SCANCODE_*</code> constants), which tells the physical location on the keyboard with reference to a US keyboard layout, and the <a href="https://wiki.libsdl.org/SDL2/SDL_Keycode" rel="nofollow">SDL_Keycode</a> (<code class="notranslate">SDLK_*</code> constants). In many cases the <code class="notranslate">SDL_Keycode</code> is equal to the non-decomposed unicode character for that key. SDL 1.2 is bit different. SDL 1.2's <code class="notranslate">SDL_keysym</code> has the raw 8-bit <code class="notranslate">scancode</code> (no constants provided), the virtual <code class="notranslate">SDLKey sym</code> (<code class="notranslate">SDLK_*</code> constants), and the corresponding unicode character.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/ohrrpgce/ohrrpgce/issues/1266">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AMWGWZX47GZLYDGULUU3CI3YH63FBAVCNFSM6AAAAABAIRENLWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDOMZZGAYTKNQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AMWGWZUKRH2ITIVUCU556J3YH63FBA5CNFSM6AAAAABAIRENLWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHRV4EZQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><ohrrpgce/ohrrpgce/issues/1266</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ohrrpgce/ohrrpgce/issues/1266",
"url": "https://github.com/ohrrpgce/ohrrpgce/issues/1266",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>