Download
inputpilot — Magic Keyboard
same keys, different board — watch Enter and left Shift change shape isoansi

The layout follows the keyboard. Not the app. Not the window.

macOS switches input sources per app and per window — never per keyboard. InputPilot watches which keyboard produced the last key press and switches the layout automatically, whether that is the built-in board or an external one. Map each keyboard once, then forget it exists.

Download for macOS Documentation

macOS 13+ · signed & notarized · Apache-2.0 · v1.0.1 · brew install --cask lucagerlich/tap/inputpilot

What it looks like when it works

Nothing. You type on the other keyboard and the language is already right. The debug log is the only place it shows its work — useful when reporting a bug, and safe to share.

Debug log EXAMPLE menu bar → Open Debug
[10:24:03.112] INFO permission    Input Monitoring granted.
[10:24:03.118] INFO hid-monitor   HID monitor started.
[10:24:07.402] INFO active-device Active device changed to Magic Keyboard (VID 1452, PID 640).
[10:24:07.806] SWITCH auto          Magic Keyboard → German
[10:31:15.220] INFO active-device Active device changed to Keychron K2 (VID 13364, PID 630).
[10:31:15.624] SWITCH auto          Keychron K2 → U.S.
[10:47:02.918] WARN conflict      Mapped source no longer enabled: com.apple.keylayout.French
[10:47:02.918] INFO active-device 
Magic Keyboard
Vendor ID1452
Product ID640
TransportUSB
LayoutGerman
Status■ active
Keychron K2
Vendor ID13364
Product ID630
TransportBluetooth
LayoutU.S.
Status■ mapped
Built-in Keyboard
Vendor ID1452
Product ID834
TransportInternal
Layoutglobal fallback
Status■ unmapped

How the automatic switching works

Three steps, once.

01

Press a key

Type on each keyboard so InputPilot learns it — built-in, external, USB or Bluetooth. Devices are remembered and recognised again after unplugging, reconnecting, or moving to another port.

02

Pick a layout

Assign an input source per keyboard in Settings. Add per-device or global fallbacks for anything unmapped.

03

Forget about it

A 400 ms debounce and a 1.5 s cooldown keep it from flapping. Modifier-only presses are ignored, so ⌘-Tab never changes your layout.

About that permission

InputPilot asks for Input Monitoring — the permission that lets an app see keyboard events. That is a lot to ask for, so here is exactly what it does with it.

It reads which keyboard sent a key press, not what you typed.

  • The HID callback takes two things from each event: the device that sent it, and whether the key was a modifier. Nothing else.
  • The key's usage code is read only to decide whether it was a modifier, then discarded. It is never stored, logged or transmitted, and no character or text is ever derived from it.
  • The only network traffic is the update check. No telemetry, no analytics, no crash reporter.
  • The source is public and the app is about 3,200 lines of Swift. The keyboard handling is 15 lines and reads in a minute.

Full privacy statement →

Questions

Why is it not on the App Store?

InputPilot is not sandboxed — it talks to IOKit's HID layer directly, which is the most reliable way to tell one physical keyboard from another. App Store apps must be sandboxed, which constrains both HID access and input-source switching. That is not an absolute barrier — OctoKeys does per-keyboard switching on the App Store — but outside the store there is no review cycle, the app stays free, and you can read every line of the thing you are granting keyboard access to. It is signed with a Developer ID certificate and notarized by Apple, so it opens without warnings.

InputPilot does not appear under Input Monitoring.

Some Macs do not populate that list automatically. Add it by hand: System Settings → Privacy & Security → Input Monitoring → + → pick InputPilot in Applications, then switch it on.

I granted permission but nothing happens.

macOS applies Input Monitoring on the next launch. Quit InputPilot and open it again.

Does it work with Bluetooth keyboards?

Yes. Keyboards are identified by vendor, product, transport and name, so a Bluetooth keyboard is recognised again after reconnecting.

I use a German external keyboard with a US MacBook. Does this fix it?

That is the case it was written for. Map the external board to German and the built-in one to U.S. once. From then on the layout is right the moment you start typing on either — no shortcut, no menu, nothing to remember.

How is this different from autokbisw, OctoKeys or Input Source Pro?

Input Source Pro and similar tools switch per app or per window. autokbisw switches per keyboard from the command line, with no interface. OctoKeys switches per keyboard on the App Store by remembering the last source you used with each one. InputPilot switches per keyboard too, but you assign the input source explicitly rather than relying on what was used last, it is open source so you can audit what it does with the permission, and it is free.

What does it cost?

Nothing. Free and open source under the Apache 2.0 licence.

Stop fixing your layout by hand

A free, open source keyboard layout switcher for macOS 13 or newer. About a minute to set up.