要求最终用户动态分配键盘快捷键
我有一个要求,最终用户可以在表单中修改键绑定。
我如何完成这个改变?到目前为止,键盘快捷键是静态的,我已经使用类似
if(key=='Z' & key=='Ctrl')
//then undo
这样的基本 if 条件在 keydown 事件中处理了它们。
我如何在 C# 中实现这一点
I have a requirement where the keybindings can be modified by the end user in a form.
How do i accomplish this change ? As of now the keyboard shortcuts are static and i have handled them in the keydown event using a basic if condition like ,
if(key=='Z' & key=='Ctrl')
//then undo
this way .
How do i accomplish this in C#
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个查找结构。关键是可能的命令或组合键 - 取决于您想要执行的操作。在键处理路由中,您可以使用键代码组合查询查找(在当前实例运行时从配置和/或手动更改的绑定生成),结果将是命令/操作。
You could create a lookup structure. The key is the possible command or the key combination - depending what you want to do. in the key handling routing, you can query the lookup (generated from config and/or manually changed bindings while the current instance runs) with the keycode combination and the result would be the command/action.