无论如何,jEdits 键盘控件的行为方式是否与本机 Mac OS 应用程序的行为方式相同?
行为我的意思是 command+left 将插入符号移动到行首,alt+left 移动到当前单词的开头等。
首先需要启用 ALT 键。在位于以下位置的 startup.bsh 文件中执行此操作:
JEDIT_HOME/Contents/Resources/Java/startup/startup.bsh
在 Mac OX 上,这通常是:
/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
不幸的是,Brian 的发现不能很好地与 QWERTZ 键盘配合使用:它禁止输入像管道、大括号或任何使用 ALT 键作为修饰符的字符的可能性。
根据startup.bsh中的评论:
/*{{{ 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+ */);
/*}}}*/
但是无论我尝试了何种设置组合,我都无法实现两个选项(ALT 作为快捷方式和文本输入的修饰符)工作的设置。
所以:任何提示/修复将不胜感激。;-)
[1] 这里的意思是:jEdit 4.3.2 @ OSX 10.5.8 (Java 1.5.0_30) with QWERTZ (German) 键盘
一个适合我的解决方案:
创建一些将您需要的特殊 alt 字符插入 textArea 的宏(每个字符一个宏)。
然后您可以更改设置以启用 jedit 的 alt 键(我只启用了两个属性中的第一个)。
之后,您可以为录制的宏分配 alt-shortcuts,这样特殊字符将被与以前相同的快捷方式插入。
之后,您可以更改文本导航的快捷方式设置以匹配 mac 标准,并且您仍然可以通过定义的宏快捷方式使用特殊字符。