locked
Non-XAML Metro App (DirectX Game)- how to bring up the virtual keyboard ?

    Question

  • Hi guys,

    for the ingame multiplayer chat i would like to bring up the virtual keyboard, so the players can actually enter text.

    I couldnt find any method to do this.

    Any tips ?

    Kind regs,

    Roman Pfneudl CEO - vertex4 entertainment ltd.

    Monday, July 9, 2012 9:32 AM

Answers

All replies

  • The virtual keyboard will come up automatically when the user sets focus to a text control. There is no way to explicitly show or hide the keyboard.

    If you are creating your own control then you will need to implement it with full accessibility information. Doing this correctly (especially with full TSF support for IMEs, type-ahead, etc.) is difficult. I strongly suggest that you use a Xaml TextBox instead of implementing your own.

    Input Hosting Manager and the Touch Keyboard
    DirectX and XAML interop (Metro style apps using C++ and DirectX) 

    --Rob

    • Proposed as answer by Jesse Jiang Tuesday, July 10, 2012 10:45 AM
    Monday, July 9, 2012 5:25 PM
    Owner
  • Hi Rob,

    Thank you. Bad news though. 
    Guess, players  without keyboard will have to live without a chatting mode then.

    Kind regs,
    Roman

    Roman Pfneudl CEO - vertex4 entertainment ltd.


    • Edited by v4corg Wednesday, July 11, 2012 8:15 AM
    Wednesday, July 11, 2012 8:12 AM
  • Hi Roman,

    You can use DirextX and Xaml interop to put a Xaml TextBox for your chat pretty easily. I strongly recommend that you do so. Another alternate (although not recommended and difficult to get right) would be to implement your own on-screen keyboard.

    Disabling features for users without a keyboard likely violates Certification Requirement 3.5 Your app must fully support touch input, and fully support keyboard and mouse input and should prevent your app from being certified.

    --Rob

    Wednesday, July 11, 2012 8:30 AM
    Owner
  • Hi Rob,

    Ok, so here is what i need:

    - adding programatically a XAML textbox in a certain area of the screen (as a child of the apps CoreWindow).
      (invisible because all my controls are rendered by my engine)
      - when tapping in there - the softkeyboard appears
      - the textbox receives all the characters the player enters which i forward to my message-loop to be processed.

    - removing this XAML textbox programmatically.

    Is this possible without having to define xaml pages for it just by attaching the control it to the CoreWindow ?

    Kind regs,
    Roman


    Roman Pfneudl CEO - vertex4 entertainment ltd.

    Wednesday, July 11, 2012 9:36 AM
  • Take a look at the DirectX and XAML interop (Metro style apps using C++ and DirectX) documentation and the SwapChainBackgroundPanel. It's very easy and I'd recommend it over rolling your own controls.

    If you do want to roll your own controls take a look at the Input: Touch keyboard sample for an example of how to implement the UIA interfaces on a custom control. This will allow the touch keyboard to pop up, but doesn't implement the TSF interfaces needed for full text input support.

    --Rob

    • Marked as answer by Jesse Jiang Tuesday, July 17, 2012 8:26 AM
    Wednesday, July 11, 2012 11:01 PM
    Owner
  • Hi Rob, 

    Ok, will take a deeper look there. Thank you for your help.

    Kind regs,


    Roman Pfneudl CEO - vertex4 entertainment ltd.

    Thursday, July 12, 2012 8:50 AM