码迷,mamicode.com
首页 > 系统相关 > 详细

又发现了一款mac快捷键神器

时间:2016-08-22 17:54:14      阅读:444      评论:0      收藏:0      [点我收藏+]

标签:

之前用applescript,还有keyboard maestro,前段时间用机械键盘的时候,用开源的karabiner重新设置机械键盘的键位。

今天因为网上抄的键位F4想换成Launchpad,所以就上网搜了搜资料,结果发现,这货设置快捷键,比起上述俩货方便多了根本不用写什么workflow

直接上代码:

<?xml version="1.0"?>
<root>
    <devicevendordef>
        <vendorname>CHERRY_KEYBORD</vendorname>
        <vendorid>0x046a</vendorid>
    </devicevendordef>

    <deviceproductdef>
        <productname>PC_KEYBOARD</productname>
        <productid>0x0011</productid>
    </deviceproductdef>

    <!-- file path -->
    <vkopenurldef>
      <name>KeyCode::VK_OPEN_URL_APP_Calculator</name>
      <url type="file">/Applications/Calculator.app</url>
    </vkopenurldef>

    <item>
        <name>CHERRY G80-3000 KEYBOARD</name>
        <identifier>private.deviceproductdef</identifier>
        <device_only>DeviceVendor::CHERRY_KEYBORD, DeviceProduct::PC_KEYBOARD</device_only>
        <identifier>private.remap.pc_to_mac</identifier>
        <autogen>__KeyToKey__ KeyCode::PC_APPLICATION, KeyCode::FN</autogen>

        <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
        <autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::OPTION_R</autogen>
        <autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
        <autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::COMMAND_R</autogen>

        <autogen>__KeyToKey__ KeyCode::F1,  ConsumerKeyCode::BRIGHTNESS_DOWN</autogen>
        <autogen>__KeyToKey__ KeyCode::F2,  ConsumerKeyCode::BRIGHTNESS_UP</autogen>
        <autogen>__KeyToKey__ KeyCode::F3,  KeyCode::EXPOSE_ALL</autogen>
        <autogen>__KeyToKey__ KeyCode::F4,  KeyCode::LAUNCHPAD</autogen>
        <!--autogen>__KeyToKey__ KeyCode::F4,  KeyCode::DASHBOARD</autogen-->
        <autogen>__KeyToKey__ KeyCode::F7,  ConsumerKeyCode::MUSIC_PREV</autogen>
        <autogen>__KeyToKey__ KeyCode::F8,  ConsumerKeyCode::MUSIC_PLAY</autogen>
        <autogen>__KeyToKey__ KeyCode::F9,  ConsumerKeyCode::MUSIC_NEXT</autogen>
        <autogen>__KeyToKey__ KeyCode::F10, ConsumerKeyCode::VOLUME_MUTE</autogen>
        <autogen>__KeyToKey__ KeyCode::F11, ConsumerKeyCode::VOLUME_DOWN</autogen>
        <autogen>__KeyToKey__ KeyCode::F12, ConsumerKeyCode::VOLUME_UP</autogen>

        <autogen>__KeyToKey__ KeyCode::KEYPAD_CLEAR, KeyCode::DELETE, ModifierFlag::COMMAND_L</autogen>
        <autogen>__KeyToKey__ KeyCode::PC_PRINTSCREEN, ConsumerKeyCode::EJECT</autogen>
    </item>
    <item>
    <name>Change right-command + c to launch calculator</name>
    <identifier>private.right_command_c</identifier>
    <autogen> __KeyToKey__ KeyCode::C, ModifierFlag::COMMAND_R, KeyCode::VK_OPEN_URL_APP_Calculator, </autogen>
    </item>
</root>

上述代码把F4改成了LAUNCHPAD,把commandR+C成为了启动计算器。这启动应用也很爽快吧?

 

又发现了一款mac快捷键神器

标签:

原文地址:http://www.cnblogs.com/zzuse/p/5796373.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!