Mesta Automation
HMI Controls WPF

WPF Touch Keyboard

As i previously did with Keypad, i rewrote the code of the for a WPF touch keyboard based on Wosk project on Codeplex.

This keyboard both support upper and lower case letter, it’s completely sizable and it’s good-looking.

I packed this together with keypad for convenience, and you can download the sample application + source code on GitHub.

Michele Cattafesta

Michele Cattafesta

Writing about C#, WPF, PLC communication, HMI software, and the practical edges of industrial automation.

Follow on LinkedIn

10 Comments

  1. With a minor modification to the constructor of both the Keypad and VirtualKeyboard classes it is possible to preserve the value of the TextBox between calls. In other words, touching the bound TextBox would pop-up the KeyPad or VirtualKeyboard with the current TextBox value for Modification/Edit as opposed to the current behavior where the result is set to an empty string requiring the operator re-enter the complete text.

    At the end of each respective constructor, change…
    Result = “”;
    to…
    Result = owner.Text;

    VirtualKeyboard.xaml.cs (line 69) and Keypad.xaml.cs (line 50) as referenced by the above linked example source.

    A further enhancement to the Keypad/VirtualKeyboard classes for “preserved edit” would allow for cursor control over the insert/delete position within the string allowing edits mid-string. Though cursor/caret management is beyond the scope of this particular reply.

    Regards

  2. is there an easy way to target the keyboard at all textboxes rather than individual textboxes in behind code. thanks Chuck R

  3. Not sure if anyone still responds to messages here but how would I go about sending keypresses to the control (like a textbox) as they occur rather than having to hit “return”?

  4. If I have to use in Page instead of window how do I do it, I am having error ” Argument 2: cannot convert from ‘GEA_HMI.View.Page1’ to ‘System.Windows.Window'”

Leave a Reply

Your email address will not be published. Required fields are marked *