Bug Report T263170
Visible to All Users

Hybrid App - The on-screen keyboard should be automatically invoked when the demo runs on tablet devices

created 10 years ago (modified 10 years ago)
Show previous comments (12)
DevExpress Support Team 9 years ago

    Hi Michael,

    I have tested this approach in Windows 10 and confirm that it does not work there. This is the reason why this functionality is not implemented on our side so far - there is no guarantee that an approach that works in one version will work on another.

    Regarding the issue on Windows 8.1, the sample Andrey attached works properly on my side, and I have the same version as you - 6.3, build version is 9600. Honestly, it's difficult to say why this approach does not work on your side. Considering the fact that the original WpfTouchKeyboard works properly on your side, the issue may be related to a specific DevExpress version. Would you please check what build of our controls you are using at the moment? You can check it in the Debug->Windows->Modules window.
    Just in case, how are you focusing editors to reproduce the issue? Are you using the touch screen or the mouse?
    I have also noticed that the keyboard is sometimes not displayed immediately - I have to tap an editor two or three times to invoke it. Please check if you have a similar issue on your side.

    As a possible alternative, try invoking the keyboard manually, for example, using Process.Start:

    C#
    Process.Start("osk.exe")

    A similar approach is described in the Adding Touch Keyboard Support to a WPF Desktop Application article.
    To invoke a keyboard when our editor is focused, you can use a handler like this one:

    C#
    public MainWindow() { InitializeComponent(); //... PreviewGotKeyboardFocus += new KeyboardFocusChangedEventHandler(MainWindow_PreviewGotKeyboardFocus); } void MainWindow_PreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) { TextEdit editor = LayoutTreeHelper.GetVisualParents((DependencyObject)e.OriginalSource).Where(x => x is TextEdit).Cast<TextEdit>().FirstOrDefault(); if (editor != null) _touchKeyboardProvider.ShowTouchKeyboard(); }
    MB MB
    Michael Bogaerts 9 years ago

      Ivan,
      I will look into it thnx,
      I did find some interesting info about issues I experienced.
      Another technique for showing and hiding the touch keyboard in a desktop application is described in detail at http://brianlagunas.com/showing-windows-8-touch-keyboard-wpf/, but at the time this article was written there was a bug in .NET Framework 4.5.2 that causes applications that use this technique to stop responding to the user. Microsoft has released hotfix 3026376 (https://support.microsoft.com/en-us/kb/3026376) to address this issue, but the hotfix must be downloaded directly from Microsoft as it is not yet available in Windows Update.
      at some point my application stopped responding… this is probably the moment everything was implemented correctly for the keyboard

      DevExpress Support Team 9 years ago

        It looks like you are right - the sample Andrey attached does not work on our machine with .NET Framework 4.5.2 installed (by the way, his sample uses the approach described in http://brianlagunas.com/showing-windows-8-touch-keyboard-wpf/). Moreover, installing .NET Framework 4.6 fixed the issue and the project started properly. Try installing that version on your side (you can download it here) and let me know if this helps.

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Additional information:

        We are happy to inform you that our developers have fixed this issue. Here is how the touch keyboard support can be turned on Windows 8/8.1:

        C#
        TouchKeyboardSupport.EnableTouchKeyboard = true; TouchKeyboardSupport.EnableFocusTracking();

        On Window 10, you can use the following options:

        1. Turn on the Tablet Mode - in this case, the keyboard will appear automatically.
        2. To enable displaying the keyboard in non-tabled mode, turn on the “Automatically show the touch keyboard in windowed apps…” option.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.