按下按钮或释放按钮时激活项目
我正在为嵌入式系统开发一个简单的 GUI。可以使用向上/向下键导航菜单,并且可以通过按确认键激活项目。目前还没有计划双按或长按,但可能会在未来的版本中实现。现在,按键是在按键释放时处理的。我喜欢这种配置,但是我是否有理由想要在按下按钮时处理按键?为什么有人会偏爱按键或按键释放?
I have a simple GUI that I am developing for an embedded system. The menus can be navigated with the up/down keys and an item can be activated by pressing a confirm key. Presently there are no double presses or long presses planned, but they might be implemented in future releases. Right now the keys are processed on key release. I like this configuration, but could there be a reason why I would want to process a key on button press instead? Any reason why someone has a preference over key press or key release?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会选择按键,因为这是用户希望发生某事的结果,并且它正在发生。
某些用户可能比其他用户移动得更慢,因此仅在释放时采取行动key 意味着延迟了用户的意图,这违背了对用户操作给予即时反馈的 UI 原则。
您更喜欢密钥发布的原因是什么?
顺便说一句,如果这些是实际的物理开关,请不要忘记在软件中进行一些去抖操作。 Jack Ganssle 的去抖动指南详细介绍了如何执行此操作。
I'd go for key press, because it's the result of the user's desire to make something happen, and it's happening now.
Some users may move more slowly than others, so to only act on release of the key means delaying the user's intention, which goes against the UI principle of giving instant feedback for user actions.
What's your reason for preferring key release?
Incidentally, if these are actual physical switches, don't forget to do some debouncing in software. Jack Ganssle's Guide to Debouncing goes into a lot of detail on how to do this.