快捷方式和条形码扫描仪

发布于 2024-12-26 09:44:58 字数 349 浏览 1 评论 0原文

在我的 WPF 应用程序中,我有一个菜单。该菜单中的选项之一分配有快捷键:CTRL+B。在我的应用程序中,我还需要能够使用条形码扫描仪扫描条形码。 我的条形码配置方式是使用 CTRL+B 组合来指定条形码起点。换句话说:条形码扫描仪发送 CTRL+B 组合来告诉我:“嘿,我现在开始向您发送条形码数字”。

我在 Window_PreviewKeyDown 事件处理程序上监听条形码输入。然而,这不起作用,因为首先,应用程序识别出 CTRL+B 被按下,并想要调用与快捷方式 CTRL+B 关联的命令执行方法。有没有办法在不改变快捷方式的情况下解决这个问题?

In my WPF Application I have a menu. One of the option from that menu has a shortcut assigned: CTRL+B. In my application I also need a possibility to scan a bar code using bar code scanner.
My bar code is configured in a way where CTRL+B combination is used to specify the bar code starting point. In other words: Bar code scanner sends CTRL+B combination to tell me: "Hey I now starting to send you the bar code numbers".

I listening for the bar code input on Window_PreviewKeyDown event handler. This however does not work because firstly, application recognizes that CTRL+B was pressed and wants to call the command's executed method associated with the shortcut CTRL+B. Is there a way to have a solution for this issue without changing the shortcut?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜深人未静 2025-01-02 09:44:59

您可以更改条形码扫描仪配置以在开始时发送一些其他密钥。
大多数条形码扫描仪都提供配置手册,您可以在其中设置此类设置。

请注意,当用户更换扫描仪或有多个用户使用不同的扫描仪时,处理条形码扫描仪中的特定字符可能会导致一些问题。

You may change the barcode scanner configuration to send some other keys at start.
Most barcode scanners provide a configuration manual where you can set such settings.

Please note that handling specific characters from barcode scanners can cause some trouble when the user changes his scanner or you have multiple users using different scanners.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文