Keyboard Input

Thats great! The showAlert feature would help a lot.

The only other missing feature that I can remember for now is Facebook support, but this one is not a blocking feature. Facebook integration usually has it’s own problems (though it’s been better since the api change), so we’ll probably launch the first version without and see add support for it later (either through our own integration or Corona’s).

Hey Joshua,

I saw in the other thread that the showAlert feature should be coming this week. Did you guys decided to include in this next build a native text field ?

We are finishing up our firsts ports, and I’d like to know where to focus next.

We’ve just finished native alert support yesterday.  We’re working on pushing out a new WP8 build to you and everyone else as soon as possible.

The next feature we were planning on implementing is system.openURL() support.

We’ve had requests for it.  We need it for our internal purposes as well.  Hopefully it will be useful to you too.

We were not planning on adding native text field support in the near future.  Have you tried implementing it yourself via Visual Studio’s designer?  I could offer some pointer to help you get started if you want to try giving that a go.

I glanced over the doc on how to use the keyboard input but haven’t done any coding yet, but it seemed straight forward enough. But I’d appreciate if you can give some pointers.

What you need to use is the .NET “System.Windows.Controls.TextBox” class, which supports single line and multiline text.

   http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox(v=vs.110).aspx

The tricky part is positioning it on the screen.  If you want to position the text box relative to Corona’s content coordinates, that’s much more difficult.  Instead, I recommend that you do something simpler and create your own “User Control” that you can display as a popup window in the middle of the screen containing all of the native text fields, labels, and buttons you need.

Here’s a quick step-by-step procedure on how you can do this:

  1. Go to the “Solution Explorer” panel in Visual Studio.

  2. Right click on the project node in the tree.  It’s the child node under the root “Solution” node.

  3. Click on “Add\Item” in the popup menu.

  4. Select “Windows Phone User Control” in the list and give the control a name like “MyPopup.xaml”.  (You can give it a better name later.)

  5. Visual Studio’s UI designer will now show you a blank user control that you can design.

  6. In Visual Studio’s “Toolbox” panel, you can drag-and-drop control such as TextBoxes and Buttons to your user control.  Go ahead and do so (for testing purposes) and then click save.

  7. Open your “MainPage.xaml.cs” file in Visual Studio.

  8. Add the following code to the bottom of the MainPage() constructor to display your user control on startup.

    var myPopup = new MyPopup(); myPopup.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; myPopup.VerticalAlignment = System.Windows.VerticalAlignment.Center; fCoronaPanel.Children.Add(myPopup);

That’s it!  You’ve now create a user control that can be used to display a native popup onscreen.  The next trick is to use Corona’s native-to-lua bridge so that your Lua script can display the popup instead of doing so in your MainPage constructor (which was just for testing purposes).  The cool thing about this approach is that you can use Visual Studio’s nice UI designer to layout the popup exactly the way you want it… and your user control is its own C# class and can control the text input and button input itself.  You’ll probably want to play with Microsoft’s layout panels too so that it’ll be sized nicely on different resolution displays, such as via a “StackPanel” class.

In any case, I hope this will be a good start for you.  The steps may look long up above, but I’m just being detailed.  This is actually a very simple way to create your own native input popups.