A thousand points to TeamViewer for mangling key shortcuts.

Between my Windows laptop and my MacBook, keys are being thoroughly mangled. Let’s see: if I press Opt-‘, I expect to see æ, but instead get å, which is the key usually produced by Opt-A.

Well, okay. That’s just one key that I have to put up with, and I can work around it —

Ah, but it’s not.

Part of the problem appears to be in the key-mapping on the client side: I type Dvorak, and have done for a few years; usually, I also complain about Windows’ terrible keyboard handling, but in this case, it seems to be working fine — or at least, fine inasmuch as it works fairly reliably, even despite the almost criminally unusable keybindings (Ctrl-Shift to change layouts, and when you press it deliberately it doesn’t, and when you’re trying to type it “spontaneously” changes…) — and the problem is instead in the way TeamViewer is translating the local keymap into a remote keymap.

I’m not sure how it’s swallowing or injecting events on the client or server systems, and I can’t really guess on OS X, but in X, there’s an extension known as XTEST which is … “a minimal set of client and server extensions required to completely test the X11 server with no user intervention,” and even in spite of disclaimers saying “This extension is not intended to support general journaling and playback of user actions,” that’s all it’s used for nowadays.

x2x, one of the great X server utilities I used for a very long time (until I switched to Synergy), uses XTEST to achieve the key event transmission across the network. Unfortunately, the model x2x uses isn’t really valid in this context. I also used osx2x for a brief while, and spent a while hacking on it to massage in a Dvorak layout conversion.

Keyboards seem to be difficult… except I’ve come across one example in the recent past that proves that keyboards are not difficult. Synergy has DWIM mastered, letting me go from a system in the Dvorak layout to a US QWERTY system, while maintaining the Dvorak layout, making typing on my Windows laptop much easier. Even better, the code is actually free, open source, cross-platform and functional — and TeamViewer even manages to match some of that, some of the time!

TeamViewer, though, appears to unshift the local keyboard layout and substitute in a US QWERTY layout as soon as either control or alt is pressed, and in some cases, does it incompletely, meaning the key marked ‘I’ on QWERTY, ‘C’ on Dvorak, could become either ‘J’ or ‘G’, with roughly equal probability, due to what appears to be incompetence.

So, the keyboard engine is worse than useless: it’s semi-functional.

Now that I can’t put up with.