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.
I'll repost here my answer from SO to the same problem:
It turns out this is a problem in Java that has existed for some years, and is still present in Java 9. See the bug report here: https://bugs.openjdk.java.net/browse/JDK-8022079
JetBrains has been aware of the problem for some years, but is waiting for Oracle to fix it. See these JetBrains bug reports: https://youtrack.jetbrains.com/issue/IDEABKL-6493 and https://youtrack.jetbrains.com/issue/IDEA-63779
In those reports you'll find a work-around using a free tool called Karabiner. I have just verified that it works for IntelliJ. It will probably also work for other Java-based tools.
The work-around is:
- Download and install Karabiner from https://pqrs.org/osx/karabiner/
- In the OSX System Preferences, set your keyboard to the default "U.S. International" PC. If you don't often type diacritics and other international characters, it's easier to just set the keyboard to "U.S" instead.
- In the Karabiner settings, type "dvorak" in the search box, then scroll down to the section
For U.S. Input Source
and check Ùse Dvorak Keyboard Layout (QWERTY to Dvorak)`
Best Answer
No, only a single keyboard layout can be active at one time and it will apply to all keyboards. But switching layouts is very simple: Apple/Command + space. Or you can no doubt make it even simpler if you want.
Update 2016: It's possible now to do this with Karabiner, as described at
Different key-maps/bindings for in-built keyboard and Bluetooth keyboard