tmk / tmk_keyboard

Keyboard firmwares for Atmel AVR and Cortex-M
3.98k stars 1.7k forks source link

The TMK mapping for an Apple M0110F ("anorexic ISO Enter") keyboard has some issues, including "missing" the space bar. #771

Closed mbfarah closed 8 months ago

mbfarah commented 8 months ago

I recently got my hands on an Apple M0110F keyboard.

image

image

I plugged this keyboard with a TMK converter, and ran into some weird mappings, two of which can be handled, and one that can't.

1) ISO# and Enter are swapped (this can be waded around by swapping them in the mapping as well; see below). 2) The R4 alphas are all shifted left (this can be waded around by shifting them right in the mapping; see below).

image

However, the third one is escaping my ability to wade around it:

3) The spacebar produces nothing; whatever is mapped to it goes to the ⌤ key to its right.

As mapped in the above image, both ⌥ keys produce LCTRL, ⌘ produces LALT, the spacebar produces nothing, and ⌤ produces ESC instead of RALT.

The keyboard is in excellent condition, so I don't believe it's a matter of a faulty PCB or something like that, and that ⌤ is producing the space bar's output as well strengthens my suspicion the problem lies in the key count within TMK itself.

I also plugged a regular TMK converter to a vanilla M0110 (en-US layout)keyboard, and all five keys in the bottom row produced their expected results.

Thank you.

tmk commented 8 months ago

Can you check this post to add support for the keyboard?

https://geekhack.org/index.php?topic=24965.msg3152999#msg3152999

mbfarah commented 8 months ago

I followed the instructions on the GH post and this is what I got:

image

tmk commented 8 months ago

hmm, it seems that converter cannot detect ISO layout using model ID unfortunately. One of my US layout M0110 uses same model ID 03. (another uses 09) This is not what I expected, and I'm disappointed at this situation.

For ISO layout you have to configure manually by one of methods below.

Edit keymap for ISO

This is possible as you did on keymap editor, but it is not intuitive nor useful.

Space bar should register RAlt with your configuration above, fyi.

For difference between US and International keyboard layout you can find in page 23 of this document.

https://www.apple.asimov.net/documentation/macintosh/Mac%20Hardware%20Info%20-%20Mac%20128K.pdf

EDIT: Keymap Editor for International layout is available now.

Switch between US layout and ISO

by pressing key combo

This is not implemented yet, but I will try later.

EDIT: This does not seem to be that useful, won't be implemented. Use keymap editor instead.

Build firmware with M0110_INTL

Compile with build option M0110_INTL to enable ISO layout.

For example, edit Makefile like below and run make -f Makefile.unimap.rev2.

diff --git a/converter/m0110_usb/Makefile.unimap.rev2 b/converter/m0110_usb/Makefile.unimap.rev2
index 1416155c..83a57dfd 100644
--- a/converter/m0110_usb/Makefile.unimap.rev2
+++ b/converter/m0110_usb/Makefile.unimap.rev2
@@ -2,5 +2,5 @@ TARGET = m0110_usb_rev2_unimap
 UNIMAP_ENABLE = yes
 KEYMAP_SECTION_ENABLE = yes
 MCU = atmega32u2
-#OPT_DEFS = -DM0110_INTL
+OPT_DEFS = -DM0110_INTL
 include Makefile

EDIT: You can change keymap by editing unimap.c.

mbfarah commented 8 months ago

Looking at the PDF, this impresses me (in a negative way):

image

Indeed, all the scan codes moved around for no reason... are as-is in the original. Shame on Apple! (almost as much shame as having both Shift keys and both Option keys sending the same scan code each). Your suggestion of tailor-editing the keymap for ISO keyboards seems to be the best one. I would add a note in the Unimap editor regarding this, if someone else should show up with the same "issue" as myself.

You are right: my keyboard's space bar should be returning RALT, but I get nothing. The keyboard is in excellent shape, so I discounted the possibility of that switch being dead... it now seems to me that this may be the reason for the space bar not returning anything.

Thank you once more.

mbfarah commented 8 months ago

I managed to force the switch under the space bar to actuate, and the result was, indeed, the one you referenced from the manual.

With this in mind, and considering that: a) "anorexic ISO Enter" M0110x models are comparatively scarce; b) they (so far) cannot be programmatically identified; c) they can be handled with the Unimap editor as-is (albeit with the caveat of shifting three groups of keys around), I'd say the best course of action is, for the time being, to leave the matter as-is, but with a note explaining how "anorexic ISO" M0110x keyboards differ from "short ANSI" M0110 units.

Thank you once more.

tmk commented 8 months ago

Keymap Editor for International layout is available now.

I'll add description in the Geekhack thread and README file for International layout support.