Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to write an localized on-screen-keyboard
    primarykey
    data
    text
    <p>I have to write an on screen keyboard for our company's program, which is mostly used on industry's PCs with touch capability.</p> <p>We can't use the windows default keyboard because we don't need all keys on the keyboard. So I was asked to write a custom one in C#.</p> <p>I already found <a href="http://www.siao2.com/2006/04/22/581107.aspx" rel="nofollow">this blog</a> as reference, but I'm not sure how to start.</p> <p>I created a small prototype GUI and assign for each key a scancode, and translate these scancodes to the related character. And send them to the active control. But I'm not sure what scancodes I should use.</p> <p>So my question is, is that the correct way to write a OSK like this and if yes which scancodes should I use? Any links?</p> <p>I'm also not sure how to handle the <kbd>shift</kbd> states...</p> <p><strong>Edit:</strong></p> <p>Okay I did a bit more research and came up with a osk which reads the current keyboard layout and even handles the easy <kbd>shift</kbd> states (<kbd>Shift</kbd> and <kbd>Alt Gr</kbd>). I wrote a <code>KeyButton</code> class which inherits from <code>Button</code>, this <code>KeyButton</code> has a <code>ScanCode</code> property of type byte and if you assign a valid scancode to it, the <code>KeyButton</code> will call the related functions to get the correct text. I used the functions from Michael Kaplan blogs with some small changes. In the end it turned out that I just had to do the same as he did.</p> <p>So the answer to my question is: Yes, you have to use scancodes on your buttons and then get the virtualkey and the unicode from the keyboard layout. <a href="http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html" rel="nofollow">Use these scancodes.</a></p> <p>Now I get the characters the only thing left is to send these around.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload