/*{{{ Remapping modifier keys part I */ /* The below is the default, swap the items around to * change meaning of C+, A+, M+, S+. */ //KeyEventTranslator.setModifierMapping(InputEvent.CTRL_MASK, // InputEvent.ALT_MASK, InputEvent.META_MASK, // InputEvent.SHIFT_MASK); /* ... and this the MacOS default: */ KeyEventTranslator.setModifierMapping( InputEvent.META_MASK, /* == C+ */ InputEvent.CTRL_MASK, /* == A+ */ InputEvent.ALT_MASK, /* == M+ */ InputEvent.SHIFT_MASK /* == S+ */); /*}}}*/ /*{{{ Remapping modifier keys part II */ /* Note if you chose to make use of the M+ (option key) prefix on MacOS, you * will need to disable a little piece of code: */ Debug.ALT_KEY_PRESSED_DISABLED = false; /* Otherwise M+ will be ignored for the purposes of keyboard shortcuts. */ /* But if you enable this, you might find that Option+8 for example invokes your * macro but also inserts a bulletpoint, as per standard Macintosh keyboard * behavior. To disable the Option key for inserting special high ASCII * characters, uncomment this. Note that it has wider implications, notably * DROVAK keyboard shortcuts will be mapped as if the keyboard was QWERTY. */ Debug.ALTERNATIVE_DISPATCHER = false; /*}}}*/ /*{{{ Workaround for buggy international key handling */ /* If international keys do not work in the text area, sometimes it is possible * to workaround the problem by adding translation mappings: */ // KeyEventTranslator.translateKey( // new KeyEventTranslator.Key("CS",KeyEvent.VK_COMMA,'\0'), // new KeyEventTranslator.Key("C",KeyEvent.VK_SEMICOLON,'\0') // ); // KeyEventTranslator.translateKey( // new KeyEventTranslator.Key(null,KeyEvent.VK_CLOSE_BRACKET,'\0'), // new KeyEventTranslator.Key(null,0,'"') // ); // KeyEventTranslator.translateKey( // new KeyEventTranslator.Key("S",KeyEvent.VK_CLOSE_BRACKET,'\0'), // new KeyEventTranslator.Key(null,0,(char)0x5e) // ); // KeyEventTranslator.translateKey( // new KeyEventTranslator.Key("C",KeyEvent.VK_CLOSE_BRACKET,'\0'), // new KeyEventTranslator.Key(null,0,'~') // ); // KeyEventTranslator.translateKey( // new KeyEventTranslator.Key(null,KeyEvent.VK_EQUALS,'\0'), // new KeyEventTranslator.Key(null,0,'\'') // ); // KeyEventTranslator.translateKey( // new KeyEventTranslator.Key("S",KeyEvent.VK_EQUALS,'\0'), // new KeyEventTranslator.Key(null,0,'`') // ); /*}}}*/