如何映射 Ctrl + TextMate 中文档的数字起始/结束到开始/结束
我真的很想按照标题中指定的方式映射这些键,但我不知道该怎么做。
我的目标是让键盘尽可能接近 Windows,因为很难忘记 25 年以上的键盘布局经验。我已经成功实现了 95% 的目标,但我无法让最后一点发挥作用。
我已将其放在 ~/Library/KeyBindings/DefaultKeyBinding.dict 中,
{
"^\UF729" = "moveToBeginningOfDocument:";
"^\UF72B" = "moveToEndOfDocument:";
}
它适用于常规 Home/End 键,但不适用于数字键盘上的键。
我也在使用 KeyRemap4MacBook,它解决了很多问题,但不是全部。
谁能帮忙解决这个问题吗?一个额外的问题是为什么新布局在某些应用程序中被忽略?
I really REALLY want to map these keys as specified in the title, but I cant find out how to do it.
My aim is to get the keyboard as close to Windows as possible since its hard to un-learn 25+ years of experience with that layout. I have managed to get 95% as I want it, but I cant get this last bit to work.
I have put this is in ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"^\UF729" = "moveToBeginningOfDocument:";
"^\UF72B" = "moveToEndOfDocument:";
}
It works with the regular Home/End keys, but not with those on the numeric keyboard.
I'm also using KeyRemap4MacBook, which solves a lot but not everything.
Can anyone help with this? A bonus question is why the new layout is ignore in some applications?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
代码片段中的键是常规的
home
和end
键。您不认为它不能与您指定的键以外的其他键一起使用吗?我不是 100% 确定,但我认为 Mac OS X 根本不支持这种“数字键作为导航键”业务,至少本身不支持。
如果您想从数字键盘重新映射
7
和1
,您必须在~/Library/KeyBindings/DefaultKeyBinding.dict< 中再添加两行/code> 这两个键。
至于你的额外问题:你的自定义键绑定仅影响 Cocoa 应用程序。您不能真正期望基于 Java/GTK/QT/Whatever 的应用程序尊重它们。 Adobe/微软的应用程序在这方面是严重的违规者。您在使用其他哪些应用程序时遇到了问题?哎呀,就连苹果公司在采用自己的狗粮方面也进展缓慢(Finder、iTunes)。
The keys in your snippet are the regular
home
andend
keys. Don't you think it's a good thing that it doesn't work with other keys than the ones you have specified?I am not 100% sure but I think that Mac OS X doesn't support this "numeric keys as navigation keys" business at all, at least natively.
If you want to remap the
7
and the1
from the numeric keypad you will have to add two more lines to~/Library/KeyBindings/DefaultKeyBinding.dict
for these two keys.As for your bonus question: your custom keybindings only affect Cocoa apps. You can't really expect Java/GTK/QT/Whatever-based applications to respect them. Apps by Adobe/Microsoft are serious offenders in this regard. What other applications do you have troubles with? Hell, even Apple has been slow at adopting their own dog food (Finder, iTunes).