autokbisw solved the per-physical keyboard layout problem for me, switching between the Macbook's layout, a US keyboard, and a UK keyboard.