使用 NSResponder -interpretKeyEvents: 时 moveBackward: 和 moveLeft: 有什么区别?
我正在使用 -interpretKeyEvents: 实现自定义文本框,并试图找出 moveBackward: 与 moveLeft: 和 moveForward: 与 moveRight: 之间的区别。 moveLeft: 绑定到向左箭头,moveBackward: 绑定到 Ctrl + B。文档对它们的描述几乎相同,并且它们在实践中的行为似乎相同。
我猜这只是 Vim 的遗留物?有谁知道真正的区别是什么?应该 moveBackward: 只调用我的 moveLeft: 实现吗?
非常感谢,
尼克
I'm implementing a custom text box using -interpretKeyEvents: and am trying to figure out what the difference is between moveBackward: vs moveLeft: and moveForward: vs moveRight:. moveLeft: is bound to the left arrow and moveBackward: is bound to Ctrl + B. The documentation describes them almost identically and they seem to behave identically in practice.
I'm assuming this is just a holdover from Vim? Does anyone know what the real difference is? Should moveBackward: just call my moveLeft: implementation?
Thanks a lot,
Nick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
比较文档,moveBackward 说它移动到选择的开头,moveLeft 说它移动到左端。所以我们问自己,左端总是开始吗?不是从右到左的文本(如希伯来语或阿拉伯语)。
Comparing the documentation, moveBackward says it moves to the beginning of the selection, and moveLeft says it moves to the left end. So we ask ourselves, is the left end always the beginning? Not in right to left text (as in Hebrew or Arabic).