What IPA layout do you use? SIL's website has one for Dvorak. You could edit other keyboard layouts with Ukelele or directly as XML.
You could also try adding something like this to private.xml in KeyRemap4MacBook.
<item>
<name>test</name>
<identifier>private.test</identifier>
<inputmode_not>ROMAN</inputmode_not>
<autogen>--KeyToKey-- KeyCode::Q, KeyCode::QUOTE</autogen>
<autogen>--KeyToKey-- KeyCode::W, KeyCode::COMMA</autogen>
<autogen>--KeyToKey-- KeyCode::E, KeyCode::DOT</autogen>
<autogen>--KeyToKey-- KeyCode::R, KeyCode::P</autogen>
<autogen>--KeyToKey-- KeyCode::T, KeyCode::Y</autogen>
<autogen>--KeyToKey-- KeyCode::Y, KeyCode::F</autogen>
<autogen>--KeyToKey-- KeyCode::U, KeyCode::G</autogen>
<autogen>--KeyToKey-- KeyCode::I, KeyCode::C</autogen>
<autogen>--KeyToKey-- KeyCode::O, KeyCode::R</autogen>
<autogen>--KeyToKey-- KeyCode::P, KeyCode::L</autogen>
<autogen>--KeyToKey-- KeyCode::BRACKET_LEFT, KeyCode::SLASH</autogen>
<autogen>--KeyToKey-- KeyCode::BRACKET_RIGHT, KeyCode::EQUAL</autogen>
<autogen>--KeyToKey-- KeyCode::S, KeyCode::O</autogen>
<autogen>--KeyToKey-- KeyCode::D, KeyCode::E</autogen>
<autogen>--KeyToKey-- KeyCode::F, KeyCode::U</autogen>
<autogen>--KeyToKey-- KeyCode::G, KeyCode::I</autogen>
<autogen>--KeyToKey-- KeyCode::H, KeyCode::D</autogen>
<autogen>--KeyToKey-- KeyCode::J, KeyCode::H</autogen>
<autogen>--KeyToKey-- KeyCode::K, KeyCode::T</autogen>
<autogen>--KeyToKey-- KeyCode::L, KeyCode::N</autogen>
<autogen>--KeyToKey-- KeyCode::SEMICOLON, KeyCode::S</autogen>
<autogen>--KeyToKey-- KeyCode::QUOTE, KeyCode::MINUS</autogen>
<autogen>--KeyToKey-- KeyCode::Z, KeyCode::SEMICOLON</autogen>
<autogen>--KeyToKey-- KeyCode::X, KeyCode::Q</autogen>
<autogen>--KeyToKey-- KeyCode::C, KeyCode::J</autogen>
<autogen>--KeyToKey-- KeyCode::V, KeyCode::K</autogen>
<autogen>--KeyToKey-- KeyCode::B, KeyCode::X</autogen>
<autogen>--KeyToKey-- KeyCode::N, KeyCode::B</autogen>
<autogen>--KeyToKey-- KeyCode::COMMA, KeyCode::W</autogen>
<autogen>--KeyToKey-- KeyCode::DOT, KeyCode::V</autogen>
<autogen>--KeyToKey-- KeyCode::SLASH, KeyCode::Z</autogen>
<autogen>--KeyToKey-- KeyCode::MINUS, KeyCode::BRACKET_LEFT</autogen>
<autogen>--KeyToKey-- KeyCode::EQUAL, KeyCode::BRACKET_RIGHT</autogen>
</item>
It's based on remap.qwerty2dvorak
in the checkbox.xml in the test folder.
If someone else was looking for a way to change the input method when holding a key, see this question.
Best Answer
Creating a hardware keyboard layout for iOS require you to assemble a .uchr file for the layout. This format is documented in the Unicode Utilities reference for the Carbon API. Such files could at one time be created with the klcompiler tool in the Font Tool Suite (!), except that it created big-endian output (probably from the PowerPC time) and iOS required little-endian output (more typical of the ARM processor), and this tool has since been retired from the Apple Download Centre, since it was 32-bits only (and there are only 64-bit versions of macOS remaining).
To install such a layout, it should be put in the
/System/Library/KeyboardLayouts
directory, which is not writable by themobile
user, but only by root. In addition, it is undocumented how new layouts are registered with the system - iOS does not scan this directory for new files as macOS does. A hack around this was to overwrite one of the existing layouts, e.g.USBKeyboardLayouts.bundle/uchrs/Colemak.uchr
, and then select this one to activate it, but this would of course violate the checksum integrity of that layout.