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

2014-12-29 10:28:41 +08:00
 pheyer

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

3028 次点击
所在节点    macOS
7 条回复
Yvette
2014-12-29 12:28:35 +08:00
或许你需要Karabiner的NumPad Hack,默认打开的
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
2014-12-29 12:58:09 +08:00
其他的程序不支持小键盘就是程序问题了,建议和作者多反应下。
pheyer
2014-12-29 13:40:24 +08:00
@Showfom 我不用zsh呢,这个我也搜到了,对我没用,不过还是谢了
yellowV2ex
2014-12-29 14:06:23 +08:00
那什么百度拼音就不支持
pheyer
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
2014-12-29 14:20:56 +08:00
@yellowV2ex 百度就是朵奇葩

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/157491

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX