有没有办法让 jEdit 的键盘控制方式与本机的 Mac OS 应用程序相同?
所谓的“相同”,是指使用 command+left 会将光标移动到行首,使用 alt+left 会将光标移动到当前单词的开头等。
有没有办法让 jEdit 的键盘控制方式与本机的 Mac OS 应用程序相同?
所谓的“相同”,是指使用 command+left 会将光标移动到行首,使用 alt+left 会将光标移动到当前单词的开头等。
首先需要启用ALT键。在startup.bsh文件中完成此操作,该文件位于:
JEDIT_HOME/Contents/Resources/Java/startup/startup.bsh
在 Mac OS 上,通常会是这样:
/Applications/jEdit.app/Contents/Resources/Java/startup/startup.bsh
以下行应该取消注释:Debug.ALT_KEY_PRESSED_DISABLED = false;
Debug.ALTERNATIVE_DISPATCHER = false;
现在您可以在键映射中包括ALT键,其中
C => CMD M => ALT
到行末:C+Right 到行首:C+Left 到下一个单词:M+Right 到上一个单词:M+Left 选择下一个单词:MS+Right 选择上一个单词:MS+Left 选择到行末:CS+Right 选择到行首:CS+Left
startup.bsh
文件中搜索'MacOS',则有一些其他需要取消注释的行(KeyEventTranslator.setModifierMapping
);这样做可以解决@BrianHeylin最初的问题。 - JJ ZabkarDebug.ALT_KEY_PRESSED_DISABLED = false;' 和 'Debug.ALTERNATIVE_DISPATCHER = false;
。 - Jorge Gil/*{{{ 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;
/*}}}*/
只需取消注释Debug.ALT_KEY_PRESSED_DISABLED
即可解决问题,但在这里[1],它并不起作用——我可以使用ALT作为快捷键的修饰符,也可以将其用作输入字符的修饰符。先前的部分还涉及修饰符的映射:
/*{{{ 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+ */);
/*}}}*/