即使没有浏览器焦点也需要键盘输入的 Web 应用程序

发布于 2024-09-30 09:10:14 字数 379 浏览 3 评论 0原文

我正在创建一个需要键盘输入的网站应用程序,特别是在没有浏览器焦点的情况下。

在不透露太多我伟大的应用程序想法(= P)的情况下,我想响应(即使只是一个)键盘按键,但要理解浏览器不会获得焦点。

我在这方面做了很多研究,并且在键盘“钩子”方面找到了很多帮助,这样无论哪个应用程序具有焦点,我都可以对关键输入做出反应(我一直在玩的那些是在vc#)。这些对于可执行文件有效,但我不确定如何通过我的网络应用程序将它们放入浏览器中。

我的问题是:无论浏览器是否具有焦点,我是否可以使用 ActiveX(或类似的任何东西 - wpf?)来访问键盘输入。

非常感谢您抽出宝贵的时间,在浪费我的时间学习如何创建和使用 ActiveX 之前(只是为了知道它不可能),我很想了解这种类型的事情是否可能。

I am creating a website application which requires keyboard input, specifically without browser focus.

Without giving too much away about my great application idea (=P), I want to respond (even to just a single) keyboard key press, with the understanding that the browser will not have focus.

I have been doing a great deal of studying on this front, and I have found much help with keyboard 'hooks', so that no matter which application has focus, I can react to key inputs (the ones I have been playing with are in vc#). And these work, for executables, but I am not sure how to get them into the browser with my web application.

What my question is: Can I use ActiveX (or anything of that ilk - wpf?) to get access to keyboard input regardless of the browser having focus or not.

Thanks so very much for your time, I would love to learn if this type of thing is even possible, before wasting my time learning how to create and use ActiveX (just to learn that it is not).

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

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

发布评论

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

评论(1

自此以后,行同陌路 2024-10-07 09:10:14

最好的(可能是唯一的)方法可能是启动一个单独的、中等完整性的进程(您必须在安装控件时正确注册该进程,否则它不会让您启动它)并在您运行该进程时运行该进程。需要您的访问权限。然后,当发生应该知道的事情时,您可以使用进程间通信向控件报告,可能会向 javascript 触发事件。

当然,要非常小心地使用它,因为如果操作不当,可能会导致重大安全漏洞,这往往会让每个人都讨厌你(大多数开发人员认为这是一件坏事)。对于进程间通信,您可以使用 boost IPC 或命名管道。

The best (possibly only) way to do this would probably be to launch a seperate, medium integrity process (you have to register that properly when you install the control or it won't let you launch it) and have the process run when you need your access. Then you can use interprocess communication to report to the control when something happens that it should know about, possibly firing an event to javascript.

Be very careful how you use this, of course, because if done improperly it could cause a major security hole which would tend to make everyone hate you (most developers consider this a bad thing). For the interprocess communication you could use boost IPC stuff or named pipes.

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