开发者

Facebook Connect w/o Keyboard on in Full Screen Mode

开发者 https://www.devze.com 2023-02-23 10:18 出处:网络
We have a requirement to use facebook connect on a touch screen kiosk tha开发者_Go百科t\'s running in windows in Kiosk Mode.There is not a physical keyboard on the kiosk. Any ideas on how to get a vir

We have a requirement to use facebook connect on a touch screen kiosk tha开发者_Go百科t's running in windows in Kiosk Mode. There is not a physical keyboard on the kiosk. Any ideas on how to get a virtual keyboard that can be used to pass credentials to facebook so that we can authenticate users? Facebook does not seem to allow support authenticating users outside of their login page.


I found a very simple solution on Windows Form. The class SendKeys can simulate keyboard events.

http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(SYSTEM.WINDOWS.FORMS.SENDKEYS.SEND);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22);k(DevLang-CSHARP)&rd=true

The setup is a form with a WebBrowserControl and a bunch of buttons for the keyboard keys. Here's the event handler for a keyboard button.

private void buttonKey_Click(object sender, EventArgs e)
    {
        Control _sender = sender as Control;
        if (_sender != null)
        {
            //focus the webBrowser
            bool focusResult = false;
            do
            {
                focusResult = webBrowser1.Focus();
                if (!focusResult)
                {
                    Thread.Sleep(100);
                }
            } while (!focusResult);

            SendKeys.Send("{TAB}");
            SendKeys.Send("+{TAB}");
            SendKeys.Send("{RIGHT}");
            SendKeys.Send(_sender.Text);
        }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消