locked
Keyboard Customization RRS feed

  • Question

  • In our WinRT application we are having issues with the keyboard popping up when it shouldn't, the size, and general use. We also have a need to change the way it works so that it is easier for data entry. Is there a way to control the keyboard or to totally customize the keyboard available in WinRT or is it just a universal thing that can't be touched?

    Thanks


    Monday, January 13, 2014 8:04 PM

Answers

  • What language (JavaScript, VB, etc.) and UI (HTML, Xaml, DirectX) are you using so we can direct you to an appropriate forum?

    The basic answer is that the app cannot directly control this. The keyboard will come up automatically when the user touches a text control. See The touch keyboard

    There may be a way to handle the problems you are seeing, but we'll need more specific details about the problem scenario.

    --Rob

    Tuesday, January 14, 2014 12:28 AM
    Moderator
  • As Rob already told, the keyboard and its behavior cannot be customized. But there are a couple of small tricks that you can apply to force it to open and close. I explained some of these here.

    One way to force a stubborn keyboard to close down, is to set programmatically the focus to an invisible control, like such:

    <!-- Closes the soft keyboard when it gets the focus -->
    <Slider x:Name="KeyboardCloser">
         <Slider.Template>
             <ControlTemplate />
         </Slider.Template>
    </Slider>

    I would however advise you to only use these tricks for patching small UI glitches, not as a general practice.

    Tuesday, January 14, 2014 9:52 AM

All replies

  • What language (JavaScript, VB, etc.) and UI (HTML, Xaml, DirectX) are you using so we can direct you to an appropriate forum?

    The basic answer is that the app cannot directly control this. The keyboard will come up automatically when the user touches a text control. See The touch keyboard

    There may be a way to handle the problems you are seeing, but we'll need more specific details about the problem scenario.

    --Rob

    Tuesday, January 14, 2014 12:28 AM
    Moderator
  • I'm using C#. The problems we are seeing is that when we close the keyboard by clicking outside of the keyboard then navigate to a new page. The keyboard opens and then closes really fast (but slow enough to see). Also in our next application we want to customize the keyboard to make it easier for data entrance into a grid.
    Tuesday, January 14, 2014 12:33 AM
  • The behavior you describe doesn't sound right, but I don't have enough context to understand why it occurs. Setting focus to a non keyboard control (again, see  The touch keyboard for a list) should close the keyboard but shouldn't immediately reopen it.

    Can you explain in more detail what the usage pattern is here? Can you provide a minimal sample which demonstrates it?

    The keyboard is not customizable beyond setting the InputScope so the most appropriate view shows.

    --Rob

    Tuesday, January 14, 2014 2:22 AM
    Moderator
  • After clicking outside of the of a text field the keyboard closes. When I click a button that takes me to the next page I actually cancel the navigation to create a special animation, and then restart the navigation when the animation is complete for a customized navigation. While the animation is running the keyboard pops up and then back down. This behavior only happens when you click outside of the keyboard to close it. If you use the keyboard close button on the keyboard this doesn't happen. I have the code at work so I might be able to get something set up for you tomorrow.
    Tuesday, January 14, 2014 2:30 AM
  • As Rob already told, the keyboard and its behavior cannot be customized. But there are a couple of small tricks that you can apply to force it to open and close. I explained some of these here.

    One way to force a stubborn keyboard to close down, is to set programmatically the focus to an invisible control, like such:

    <!-- Closes the soft keyboard when it gets the focus -->
    <Slider x:Name="KeyboardCloser">
         <Slider.Template>
             <ControlTemplate />
         </Slider.Template>
    </Slider>

    I would however advise you to only use these tricks for patching small UI glitches, not as a general practice.

    Tuesday, January 14, 2014 9:52 AM