XNA displays on-screen xbox keyboard on PC

I need to show and enter text into an xbox-like on-screen keyboard. Unfortunately, when I call Guide.BeginShowKeyboardInput, only some kind of funny text box is displayed, and I have to fill it in from the keyboard. I know that on PC iv it’s very normal to use the keyboard, but in my case I MUST enter text through the gamepad using xbox on the on-screen keyboard.

Is there any way to achieve this? Call xbox on-screen keyboard on PC?

+5
source share
5 answers

If you need one, like a touch monitor, you can do

 using System.Diagnostics;
 using System.IO;

then use this function

  Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.System) + Path.DirectorySeparatorChar + "osk.exe");

but if you need it to work with the xbox controller, you probably need to create your own

+4

. ( ), . ( ), .

f orm this link

Blockquote , . , , , , . , , , 50% . , , . , .

Blockquote , . - - , , . msn.com. - , , , Bing , . , , , , - . , , , . , .

+2

, :

static public string GetKeyboardInput() 
{ 
    if (HandleInput.currentState.IsButtonDown(Buttons.B)) 
    { 
        useKeyboardResult = false; 
    } 

    if (KeyboardResult == null && !Guide.IsVisible) 
    { 
         string title = "Name"; 
         string description = "Pick a name for this game"; 
         string defaultText = "Your name here"; 

         pauseType = PauseType.pauseAll; 
         KeyboardResult = Guide.BeginShowKeyboardInput(HandleInput.playerIndex, title, 
                                                       description, defaultText, null, null); 

         useKeyboardResult = true; 
         pauseType = PauseType.pauseAll; 

     } 
     else if (KeyboardResult != null && KeyboardResult.IsCompleted) 
     { 
          pauseType = PauseType.none; 
          KeyboardInputRquested = false; 

          string input = Guide.EndShowKeyboardInput(KeyboardResult); 
          KeyboardResult = null; 

          if (useKeyboardResult) 
          { 
               return input; 
          } 
     } 

     return null; 
} 

Update - :

if (KeyboardInputRequested) 
{ 
    string result = GetKeyboardInput(); 
} 

if (result != null) 
{ 
    //use result here 
} 
+1

, XNA DLL , , .NET(, ILSpy) .

, chatpad . , , , , , MonoGame ( XNA) . , , .

0
source

All Articles