KeymapScheme (Keymap active) { if (active == null) active = KeymapManager.getInstance().getActiveKeymap(); KeymapScheme found = null; for (KeymapScheme scheme : list) { Keymap keymap = scheme.getOriginal(); if (keymap == active) return scheme; // return active keymap if it is present if (found == null || KeymapManager.MAC_OS_X_10_5_PLUS_KEYMAP.equals(keymap.getName())) { // select MacOS X keymap if default keymap is filtered out // select first keymap if MacOS X keymap is not present found = scheme; } } return found; }