Mac-book 外接键盘热键修改


用karabiner来加热键

增大减小音量:

<?xml version="1.0"?>
<root>
<item>
<name>Volume Keys</name>
<appendix>Up, Down</appendix>
<identifier>remap.volumeKeys</identifier>
<autogen>--KeyToConsumer-- KeyCode::F14, ConsumerKeyCode::VOLUME_DOWN</autogen>
<autogen>--KeyToConsumer-- KeyCode::F15, ConsumerKeyCode::VOLUME_UP</autogen>
</item>
</root>

把以上代码放入,然后reload一个就好了

 

HOME和END键的设置

preferences->change key->for pc Users->Use PC Style Home/End

然后选上,就好了

 

 

后来发现,在Terminal中Home和End不好使,用以下方法修改就可以了

<!-- Custom keyboard mappings for MBP using https://pqrs.org/macosx/keyremap4macbook/ -->
<root>
    <item>
        <name>Lari's PC Style Home/End</name>
        <appendix>(Change Home to Command+Left)</appendix>
        <appendix>(Change End to Command+Right)</appendix>
        <appendix></appendix>
        <appendix>{{ PC_STYLE_BINDINGS_IGNORE_APPS_DESCRIPTION }}</appendix>
        <identifier>lari.remap.pclikehomeend</identifier>
        <block>
            <only>DREAMWEAVER</only>
            <autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::HOME, ModifierFlag::SHIFT_L</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_END,  KeyCode::END,  ModifierFlag::SHIFT_L</autogen>
        </block>
        <block>
            <only>BLUEFISH,WORD,EXCEL,POWERPOINT</only>
            <autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::HOME</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_END,  KeyCode::END</autogen>
        </block>
        
        <block>
            <only>EMACS, TERMINAL, X11, ECLIPSE</only>
            <autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::A, ModifierFlag::CONTROL_L</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_END,  KeyCode::E, ModifierFlag::CONTROL_L</autogen>
        </block>
         
        <block>
            <not>{{ PC_STYLE_BINDINGS_IGNORE_APPS }}</not>
            <autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_UP,    ModifierFlag::COMMAND_L</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_UP,    ModifierFlag::COMMAND_L</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_END,  MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_DOWN,  ModifierFlag::COMMAND_L</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_END,  MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_DOWN,  ModifierFlag::COMMAND_L</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_HOME,             KeyCode::CURSOR_LEFT,  ModifierFlag::COMMAND_L</autogen>
            <autogen>__KeyToKey__ FROMKEYCODE_END,              KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L</autogen>
        </block>
    </item>
</root>

把上述代码粘贴进去,就可以了.

 

后来发现在MATLAB中也不好使,将上述代码改成

<?xml version="1.0"?>
<root>
<item>
<name>Volume Keys</name>
<appendix>Up, Down</appendix>
<identifier>remap.volumeKeys</identifier>
<autogen>--KeyToConsumer-- KeyCode::F14, ConsumerKeyCode::VOLUME_DOWN</autogen>
<autogen>--KeyToConsumer-- KeyCode::F15, ConsumerKeyCode::VOLUME_UP</autogen>
</item>

<appdef>
<appname>MATLAB</appname>
<equal>com.mathworks.matlab</equal>
</appdef>


<item>
<name>Lari's PC Style Home/End</name>
<appendix>(Change Home to Command+Left)</appendix>
<appendix>(Change End to Command+Right)</appendix>
<appendix></appendix>
<appendix>{{ PC_STYLE_BINDINGS_IGNORE_APPS_DESCRIPTION }}</appendix>
<identifier>lari.remap.pclikehomeend</identifier>
<block>
<only>DREAMWEAVER</only>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::HOME, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::END, ModifierFlag::SHIFT_L</autogen>
</block>
<block>
<only>BLUEFISH,WORD,EXCEL,POWERPOINT,MATLAB</only>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::HOME</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::END</autogen>
</block>
<block>
<only>EMACS, TERMINAL, X11, ECLIPSE</only>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::A, ModifierFlag::CONTROL_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::E, ModifierFlag::CONTROL_L</autogen>
</block>
<block>
<not>{{ PC_STYLE_BINDINGS_IGNORE_APPS }}</not>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L</autogen>
</block>
</item>


</root>

这样就OK了

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM