.NET Kiosk 屏幕键盘

发布于 2024-07-22 20:27:01 字数 654 浏览 4 评论 0原文

我为我们的信息亭应用程序开发了一个相当简单的 OSK。 它的工作原理是打开 .net 应用程序中文本框触发的 onfocus 事件。 问题是,我们正在尝试与单点登录服务集成,这意味着我们将打开一个网络浏览器控件来处理第三方身份验证。 由于 SSO 页面的文本框位于浏览器控件内部,因此我不完全确定使用现有 OSK 的最佳方式,或者是否可以。

我最初的想法是尝试某种 JavaScript 注入,以便添加我的应用程序可以响应的事件。 然后我应该能够判断文本框何时获得焦点,并打开 OSK。 OSK 关闭后,我可以使用键入的值更新表单字段。 我的问题是它似乎很脆弱。 SSO 页面上 html/js 的更改可能会扰乱所有信息亭的登录过程。

我看到的另一个选择是废弃我拥有的 OSK 并使用较低级别的 OSK。 我发现这种方法的问题是我似乎发现 OSK 软件的可编程性很差。 每当我需要从用户那里获取键盘输入时,我基本上都需要启动第 3 方 exe,而且它看起来不像现有解决方案那样顺利。

我可以将两者结合起来,使用我们的 OSK 进行正常的 winforms 控件,并在需要使用 Web 控件时切换到第 3 方 OSK,但我认为每个人都可以看到这种方法的问题。

任何关于走哪条路的建议/建议,以及任何关于实现通用 JavaScript 注入以允许我使用现有 OSK 的帮助都会很棒!

I've developed a rather simple OSK for our kiosk application. It works by opening on the onfocus events fired by textboxes in our .net app. The problem is, we're trying to integrate with a single sign-on service which means we'll be opening a webbrowser control to handle the third party authentication. Since the textboxes for the SSO page are inside the browser control, I'm not entirely sure the best way to use the existing OSK, or if I even can.

My initial thoughts are to try some sort of javascript injection in order to add events that my application can respond to. Then I should be able to tell when a textbox receives focus, and open the OSK. Once the OSK is closed, I can update form field with the value that was typed. My problem with this is it seems to be quite fragile. A change in html/js on the SSO page could mess up the sign-in process for all kiosks.

The other option I see is to scrap the OSK I have and use a lower level one. The problem I see with this approach is the poor programability of the OSK software I seem to be finding. I would essentially need to launch a 3rd party exe whenever I needed to get keyboard input from the user and it wouldn't seem like as smooth of an integration as I could get with the existing solution.

I could go with a mix of the two, using our OSK for normal winforms controls and switch to the 3rd party OSK whenever I need to use the webcontrol, but I think everyone could see the problem with that approach.

Any advice/suggestions on which way to go, and any help on implementing a generic javascript injection to allow me to use my existing OSK would be great!

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

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

发布评论

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

评论(1

Spring初心 2024-07-29 20:27:01
private void Form1_Load(object sender, EventArgs e)
{
    webBrowser1.ObjectForScripting = this;
    webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(LoadComplete);
    webBrowser1.Navigate("http://www.google.com");
}

public void LoadComplete(object sender, WebBrowserDocumentCompletedEventArgs args)
{
    foreach(HtmlElement input in webBrowser1.Document.GetElementsByTagName("input"))
    {
        if (input.GetAttribute("type").ToLower() == "text")
        {
            input.Click += new HtmlElementEventHandler(Clicked);
        }
    }
}

public void Clicked(object sender, HtmlElementEventArgs args)
{
    // Show OSK, Get Results Text
        (sender as HtmlElement).SetAttribute("value", oskText);
}
private void Form1_Load(object sender, EventArgs e)
{
    webBrowser1.ObjectForScripting = this;
    webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(LoadComplete);
    webBrowser1.Navigate("http://www.google.com");
}

public void LoadComplete(object sender, WebBrowserDocumentCompletedEventArgs args)
{
    foreach(HtmlElement input in webBrowser1.Document.GetElementsByTagName("input"))
    {
        if (input.GetAttribute("type").ToLower() == "text")
        {
            input.Click += new HtmlElementEventHandler(Clicked);
        }
    }
}

public void Clicked(object sender, HtmlElementEventArgs args)
{
    // Show OSK, Get Results Text
        (sender as HtmlElement).SetAttribute("value", oskText);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文