GUIs should be fully keyboard-driven
GUIs should be fully keyboard-driven
图形用户界面(GUI)应实现全键盘操作
This post has made it to the Hacker News front page. See the discussion. 这篇文章登上了 Hacker News 的首页。查看讨论。
Last week I came across a post on Hacker News that encouraged application developers to stop making terminal user interfaces (a.k.a. TUIs) and instead focus on graphical user interfaces (a.k.a. GUIs). The post reached the HN front page and sparked a lively debate in the comments section. 上周,我在 Hacker News 上看到一篇文章,鼓励应用程序开发者停止开发终端用户界面(即 TUI),转而专注于图形用户界面(即 GUI)。这篇文章登上了 HN 首页,并在评论区引发了激烈的辩论。
I think there is merit in both sides of the debate. On one hand, I understand the GUI-positive arguments of the post author. In theory, the capabilities of GUI application frameworks are a superset of the capabilities of their TUI counterparts, so they should be preferred. 我认为辩论双方都有其道理。一方面,我理解文章作者支持 GUI 的观点。从理论上讲,GUI 应用程序框架的功能是 TUI 框架功能的超集,因此理应更受青睐。
On the other hand, as a heavy terminal user, I also greatly appreciate all TUIs that allow me to “stay” in the terminal and fulfill all my needs. But I want to oppose a recurring argument in favor of TUIs that in my opinion does not have a solid foundation. To paraphrase various commenters: TUIs should be preferred because they are keyboard-driven. 另一方面,作为一名重度终端用户,我也非常欣赏那些能让我“留在”终端并满足我所有需求的 TUI。但我想要反驳一个支持 TUI 的常见论点,在我看来,这个论点缺乏坚实的基础。套用多位评论者的话:TUI 更受青睐是因为它们是键盘驱动的。
While it’s true that if you randomly pick a GUI and a TUI application, the latter is more probable to be fully keyboard-driven, this does not tip the scale in favor of developing TUIs over GUIs. What it does is highlight the inadequacies of keyboard navigation in many GUI applications. 虽然确实,如果你随机挑选一个 GUI 和一个 TUI 应用程序,后者更有可能实现全键盘操作,但这并不能成为开发 TUI 优于 GUI 的理由。这反而凸显了许多 GUI 应用程序在键盘导航方面的不足。
There is nothing preventing a GUI from being fully keyboard-driven just like — or even better than — a TUI. In fact, many GUI framework application guidelines explicitly encourage GUI application developers to provide support for keyboard-driven navigation that covers the whole functionality of the application. 没有任何理由阻止 GUI 像 TUI 一样实现全键盘操作,甚至做得更好。事实上,许多 GUI 框架的应用指南都明确鼓励开发者提供覆盖应用程序全部功能的键盘导航支持。
For example, the GNOME Human Interface Guidelines state that just as it should be possible to perform every action with a pointing device, every action should also be possible with the keyboard and that it should be possible to move around and interact with every part of your user interface using the keyboard. 例如,GNOME 人机交互指南指出,正如用户应该能够通过定点设备执行每一个操作一样,每一个操作也应该能够通过键盘完成;并且用户应该能够使用键盘在用户界面的各个部分之间移动并进行交互。
This resonates with me as a user. Being able to intuitively — and predictably — navigate around a GUI application with only my keyboard gives me more incentive to choose it compared to its alternatives. Knowing that, and when wearing my developer hat, I have to make sure that my applications are keyboard-friendly. 作为用户,这引起了我的共鸣。能够仅通过键盘直观且可预测地操作 GUI 应用程序,会让我更有动力去选择它,而不是其他替代品。意识到这一点后,当我以开发者身份工作时,我必须确保我的应用程序对键盘操作友好。
For my first ever GUI application, Klisi, I invested some time to implement keyboard shortcuts targeting the whole range of available actions. Keyboard navigation is not that hard to achieve in most cases and results in an overall better user experience. It is not a matter of feasibility, but a matter of will on the application developer’s part. 在我的第一个 GUI 应用程序 Klisi 中,我投入了一些时间来实现覆盖所有可用操作的键盘快捷键。在大多数情况下,实现键盘导航并不难,而且能带来更好的整体用户体验。这并非可行性问题,而是应用程序开发者意愿的问题。
The takeaway is simple. Do not compromise on the user experience you provide with your application. Strive to make it as intuitive as possible. To that end, enabling full keyboard navigation should not be ignored. 结论很简单:不要在应用程序提供的用户体验上妥协。努力使其尽可能直观。为此,实现全键盘导航不应被忽视。