jEdit Mac OS 键盘行为

发布于 2024-08-22 01:03:27 字数 111 浏览 6 评论 0原文

是否有办法让 jEdits 键盘控件的行为与本机 Mac OS 应用程序相同?

我所说的行为是指 command+left 将插入符号移动到行的开头,alt+left 移动到当前单词的开头等。

Is there anyway to have jEdits keyboard controls behave the same way that a native Mac OS app does?

By behave I mean command+left moves the caret to the start of the line, alt+left moves to the beginning of the current word etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

酸甜透明夹心 2024-08-29 01:03:28

不幸的是,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 (德语) 键盘

Unfortunately Brian's findings do not play well with QWERTZ keyboards: it disables the possibility to enter chars like pipe, curly brackets, or whatever uses the ALT-key as modifier.

According to the comments in 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;

/*}}}*/

only uncommenting Debug.ALT_KEY_PRESSED_DISABLED should do the trick, but here[1] it doesn't - I can either use ALT as modifier for shortcuts, or as a modifier for entering chars.. a prior section also deals with the mapping of modifiers:

/*{{{ 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+ */);

/*}}}*/

but whatever combination of settings I tried, I wasn't able to achieve a setup with both options (ALT as modifier for shortcuts and textinput) working.

So: any hint/fix would be highly appreciated. ;-)

[1] here means: jEdit 4.3.2 @ OSX 10.5.8 (Java 1.5.0_30) with QWERTZ (German) keyboard

懒的傷心 2024-08-29 01:03:28

适合我的解决方案:

创建一些宏,将所需的特殊替代字符插入到文本区域中(每个字符一个宏)。

然后您可以更改设置以启用 jedit 的 alt 键(我只启用了两个属性中的第一个)。

之后,您可以为您录制的宏分配 alt 快捷键,特殊字符将由与之前相同的快捷键插入。

之后,您可以更改文本导航的快捷方式设置以匹配 mac 标准,并且您仍然可以通过定义的宏快捷方式使用特殊字符。

A solution that works for me:

Create some macros that insert the special alt-characters you need into the textArea (one macro per character).

Then you can change the setup to enable the alt-key for jedit (I enabled only the first of the two properties).

After that you can assign alt-shortcuts for the macros you recorded in a way that the special characters will be insterted by the same shortcus as before.

After that you can change the shortcut-setup for text-navigation to match the mac-standard and you will still have the special characters available through the defined macro-shortcuts.

分开我的手 2024-08-29 01:03:27

首先需要启用 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
Go to End of Line: C+Right  
Go to Start of Line: C+Left 
Go to Next Word: M+Right 
Go to Previous Word: M+Left 
Select Next Word: MS+Right 
Select Previous Word: MS+Left 
Select to End of Line: CS+Right 
Select to Start of Line: CS+Left

First the ALT key needs to be enabled. Do this in the startup.bsh file located in:

JEDIT_HOME/Contents/Resources/Java/startup/startup.bsh

On Mac OX this would typically be:

/Applications/jEdit.app/Contents/Resources/Java/startup/startup.bsh

The following lines should be uncommented:

Debug.ALT_KEY_PRESSED_DISABLED = false;
Debug.ALTERNATIVE_DISPATCHER = false;

You can now include the ALT key in keymappings, where

C => CMD
M => ALT
Go to End of Line: C+Right  
Go to Start of Line: C+Left 
Go to Next Word: M+Right 
Go to Previous Word: M+Left 
Select Next Word: MS+Right 
Select Previous Word: MS+Left 
Select to End of Line: CS+Right 
Select to Start of Line: CS+Left
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文