V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
pheyer
V2EX  ›  macOS

Mac 上有些软件用不了小键盘,怎么破

  •  
  •   pheyer · 2014-12-29 10:28:41 +08:00 · 3029 次点击
    这是一个创建于 3621 天前的主题,其中的信息可能已经有所发展或是发生改变。

    RT,就是小键盘完全没用,输入不了数字,只能用大键盘上的数字键输入数字,但是大部分软件用小键盘是没问题的。想用键盘映射,又不知道怎么弄,求支个招

    7 条回复    2014-12-29 14:20:56 +08:00
    Yvette
        1
    Yvette  
       2014-12-29 12:28:35 +08:00
    或许你需要Karabiner的NumPad Hack,默认打开的
    Showfom
        2
    Showfom  
       2014-12-29 12:56:52 +08:00
    .zshrc 里添加

    # Fix numeric keypad
    # 0 . Enter
    bindkey -s "^[Op" "0"
    bindkey -s "^[On" "."
    bindkey -s "^[OM" "^M"
    # 1 2 3
    bindkey -s "^[Oq" "1"
    bindkey -s "^[Or" "2"
    bindkey -s "^[Os" "3"
    # 4 5 6
    bindkey -s "^[Ot" "4"
    bindkey -s "^[Ou" "5"
    bindkey -s "^[Ov" "6"
    # 7 8 9
    bindkey -s "^[Ow" "7"
    bindkey -s "^[Ox" "8"
    bindkey -s "^[Oy" "9"
    # + - * /
    bindkey -s "^[Ol" "+"
    bindkey -s "^[Om" "-"
    bindkey -s "^[Oj" "*"
    bindkey -s "^[Oo" "/"

    这样 zsh 就可以小键盘了
    Showfom
        3
    Showfom  
       2014-12-29 12:58:09 +08:00
    其他的程序不支持小键盘就是程序问题了,建议和作者多反应下。
    pheyer
        4
    pheyer  
    OP
       2014-12-29 13:40:24 +08:00
    @Showfom 我不用zsh呢,这个我也搜到了,对我没用,不过还是谢了
    yellowV2ex
        5
    yellowV2ex  
       2014-12-29 14:06:23 +08:00
    那什么百度拼音就不支持
    pheyer
        6
    pheyer  
    OP
       2014-12-29 14:19:29 +08:00
    @Yvette 其实上午弄过Karabiner,但是不得要领,不知道怎么映射。刚才研究了一下,成功搞定,其实也很简单,就是把小键盘上的数字键映射成大键盘上的数字键。

    我做的private.xml代码如下:
    <?xml version="1.0"?>
    <root>
    <item>
    <name>Change KeyPad 0 to Num 0</name>
    <identifier>private.change_keypad0_to_num0</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_0, KeyCode::KEY_0</autogen>
    </item>

    <item>
    <name>Change KeyPad 1 to Num 1</name>
    <identifier>private.change_keypad1_to_num1</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_1, KeyCode::KEY_1</autogen>
    </item>

    <item>
    <name>Change KeyPad 2 to Num 2</name>
    <identifier>private.change_keypad2_to_num2</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_2, KeyCode::KEY_2</autogen>
    </item>

    <item>
    <name>Change KeyPad 3 to Num 3</name>
    <identifier>private.change_keypad3_to_num3</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_3, KeyCode::KEY_3</autogen>
    </item>

    <item>
    <name>Change KeyPad 4 to Num 4</name>
    <identifier>private.change_keypad4_to_num4</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_4, KeyCode::KEY_4</autogen>
    </item>

    <item>
    <name>Change KeyPad 5 to Num 5</name>
    <identifier>private.change_keypad5_to_num5</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_5, KeyCode::KEY_5</autogen>
    </item>

    <item>
    <name>Change KeyPad 6 to Num 6</name>
    <identifier>private.change_keypad6_to_num6</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_6, KeyCode::KEY_6</autogen>
    </item>

    <item>
    <name>Change KeyPad 7 to Num 7</name>
    <identifier>private.change_keypad7_to_num7</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_7, KeyCode::KEY_7</autogen>
    </item>

    <item>
    <name>Change KeyPad 8 to Num 8</name>
    <identifier>private.change_keypad8_to_num8</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_8, KeyCode::KEY_8</autogen>
    </item>

    <item>
    <name>Change KeyPad 9 to Num 9</name>
    <identifier>private.change_keypad9_to_num9</identifier>
    <autogen>__KeyToKey__ KeyCode::KEYPAD_9, KeyCode::KEY_9</autogen>
    </item>

    <item>
    <name>Change KeyPad Enter to Return</name>
    <identifier>private.change_keypadEnter_to_return</identifier>
    <autogen>__KeyToKey__ KeyCode::ENTER, KeyCode::RETURN</autogen>
    </item>

    </root>


    我参考的资料:
    How to add your own settings: https://pqrs.org/osx/karabiner/document.html.en#privatexml
    private.xml参考手册: https://pqrs.org/osx/karabiner/xml.html.en
    pheyer
        7
    pheyer  
    OP
       2014-12-29 14:20:56 +08:00
    @yellowV2ex 百度就是朵奇葩
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5559 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:55 · PVG 15:55 · LAX 23:55 · JFK 02:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.