-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ibmpc/xt] Firmware incorrectly maps < & > to ' * for XT keyboards #702
Comments
What keyboard are you refering to? Can you post a pic or a link? As far as I know IBM didn't define XT scan codes for those international keys officially. So internatioanl keyboard support is likely to dependent on manufacturer. TMK firmware is basically compliant with this old 'scan code translation table' published by Microsoft. In TMK converter XT scan code(Set 1) 0x29 is handled as ` ~ key(on US layout) and 0x56 as Non-US \and |.
Refer this for IBM XT keyboard layout: https://www.seasip.info/VintagePC/ibm_1501105.html |
Hasu–this is the issue I referred to on geekhack. The layout is probably not official, as it is a combination of US ANSI (big-ass enter) and ISO. The keyboard is a NTC KB-6252EA – https://images.finncdn.no/dynamic/960w/2021/7/vertical-0/26/4/226/105/014_2034820777.jpg It works with the same extended layout on multiple OSes – Linux, OSX. The keys affected is the 0x56 XT code in your table above, and the | & § key (which is on the upper left-hand side, right under Escape on ISO keyboards) It must be adhering to some kind of standard, as the Soarer firmware handled it without issues, as well as a PS2-to-USB keyboard+mouse dongle (Aten branded). I mentioned IBM as this is the firmware on the TMK adapter, not based on the layout. Hopefully the picture above makes it clearer. :) |
Thanks for the pic. It is useful for future reference. Is there the problem on Windows or Linux also? only on MacOS? Please share Soarer's coverter hid_listen log to see how it converter the keys. Again, what's your keyboard layout on computer? And do you know what language the keyboard was designed for ? I guess Danish or Swedish? |
The issue is the same on Linux and OSX, except that OSX switches the | § and < > keys for every non-ANSI keyboard (it has a bug which defaults to ANSI) (in this case the ' * and < > are switched) The behaviour above is from Linux, where it works as it should. The layout is extended ISO 105-key (Norwegian). I'll include a hid_listen capture when using the Soarer (sorry–thought I did this, but apparently the above output is from using the TMK.) Lastly, I am only using default keymaps, nothing has been edited. (Not really an option as I would have to do this on a number of systems.) |
That is exactly what I expected. Thanks for the explanation. As for key next to backspace on the keyboard, what XT scan code it sends and what charactor it register? Translation in current implementation:
*: this is a bug and should be 0x64. Translation ISO-preferable :
(EDIT: I was confused. Microsoft table is correct in the end. 2021-08-16) This translation may not work for US layout users by default. I'll look into a bit more. |
Here's the hid_listen debug output when the keyboard is in XT mode connected to the Soarer: Key next to backspace: (outputs ' and * with Shift) '
* (w/ shift)
< (right of left shift)
> (w/ shift)
| (below Escape):
§ (w/ Shift):
|
I assmume that the Soarer's behaviour tested on Windows or Linux, right? So Soarer's translation is like below.
And I believe this is current TMK translation.
So TMK problem is the <> key only(on Linux or Windows), right? I think I was confused with MacOS swap problem you refered at same time. Let's forget MacOS temporarily here. |
I think you were right the first time (your first table), as it only affects the "<" key (which should send USB HID code 64). I did another test now with the most recent (AFAIK) TMK firmware. All tests are done on Linux. So with your firmware, the "<" key (to the right of the left shift), outputs ' (tick). With shift, it outputs * (asterisk). As you noticed earlier, there is also a dedicated key for ' & * on this layout (next to backspace), and it works as expected with the TMK firmware in XT mode. hid_listen capture when using your adapter / TMK firmware:
As you see, r29 and r36 are correct. I am unsure why | § was not registering correctly with the initial capture. But hopefully this clears things up a bit. |
Map XT 0x56(ISO <) to USB 0x64(Non-US \) #702
That result is reasonable for current TMK implementation, which has a bug on the <> key. Just fixed code for the <> key. Try this firmware. New TMK firmware should behave like below, as same as Soarer's does and Microsoft describes.
|
Sorry for the late update; I can confirm that your commit fixes the issue and that "<" / ">" is now properly output in XT mode for the key next to the left shift on this ISO (NO) layout keyboard – thanks! Verified the other keys as well, and everything appears to be correctly mapped. btw., there is a (cosmetic) error in the table above showing backtick instead of tick (` *) vs. (' *) It is only cosmetic, as the correct character is output with your firmware – i.e, ' (tick). :) Just thought I'd mention it to avoid future mixups. Anyway, I think the ticket can be closed. Thanks for your assistance as always! 👍 |
Thank you for the test. I'll update main repo and prebuilt firmware files of IBMPC converter soon later. |
The TMK firmware (tested several versions) appears to re-map the "<" key (to the right of the Left shift) as ' (tick). This only occurs when the keyboard is in XT mode. If it's in AT mode the mapping is correct.
Conversely, the | and § key (on the top-left, next to 1) outputs "<" & ">". (A common problem is that these are switched, but this is not completely true with the TMK, which outputs ' & * instead, meaning there are two keys which outputs identical characters on "extended" ANSI layouts)
With the Soarer, the keys are mapped correctly (i.e, < > and | §)
Output from hid_listen showing which keycodes are registered; for the < + > (shift + <): (which outputs ' *
Output from hid_listen when pressing the | + § keys (which outputs < >)
Note that | and § are not switched (common mistake, ref. OSX, maybe other OS-es), but that ' * are output (which there is a dedicated key for on this keyboard, on row 2 due to the “big ass Enter” key.
The text was updated successfully, but these errors were encountered: