代码之家  ›  专栏  ›  技术社区  ›  BefittingTheorem

jedit mac os键盘行为

  •  10
  • BefittingTheorem  · 技术社区  · 15 年前

    有没有让jedits的键盘控件和本机Mac OS应用程序的行为一样?

    我的意思是命令+左移插入符号到行首,alt+左移到当前单词的开头等。

    3 回复  |  直到 8 年前
        1
  •  10
  •   BefittingTheorem    14 年前

    首先,需要启用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;
    

    现在可以在keymappings中包含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
    
        2
  •  3
  •   Sufian    8 年前

    不幸的是,布莱恩的发现并不能很好地与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 这是应该的,但这里没有-我可以 任何一个 将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作为快捷方式的修改器)来实现设置。 textinput)工作。

    所以:任何提示/解决方法都将受到高度赞赏。;-)

    [1 ]这里的意思是:JEDDIT 4.3.2@ OSX7.5.8(Java1.5.0EY30)与QWRTZ(德国)键盘

        3
  •  1
  •   user1389206    12 年前

    适合我的解决方案:

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

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

    之后,您可以为录制的宏指定alt快捷方式,这样特殊字符将被相同的短字符插入。

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