Widget for text input...

The widgetstown editText is the best option for now, but it still has some fontScale issues, specially on Android.

I spent last week working on a 100% widget textField and I got some pretty good results. But I got stuck trying to disable the spelling correction, since Corona does not give access to disable it.

Without that problem, I really think it is very possible to have it working in a way that solves the native problems.

I have only started my struggle with textInputs and I’m already about to throw my computer out of the window… :angry:

I have one suggestion to Corona:

As it seems that you are not capable of making a functioning textInput widget (this is your own words as far as I’m able to interpret the above), could you at least remove " Business Apps" from the front page of your the coronalabs.com web site?

I agree. For a Windows user trying to build a “BUSINESS APP” it is not right to advertise the very same business app on your front page. We are left to either look for a mac to build on. Please specify that business apps can be coded only via a MAC. It is very misleading to windows users WHO INVEST and BUY a PRO SUBSCRIPTION and only find this out way down the line that basic text inputs cannot be used or simulated… i mean what happens when a user building a game tries to have a text input but cant?

Kind Regards

Greg

I’ve been struggling for a week to get a textfield working.  Rob, your solution works decently, except for the font scaling, but even then, it works better than my current one’s font scaling. It’s odd, because I copied yours, and it still doesn’t work the same for me. :slight_smile:

I did notice that yours doesn’t work in a scrollviewer (because the x and y properties of the field don’t actually change when it’s scrolling up/down), so I had to do something like this:

 local function syncFields(event) local xOffset, yOffset = background:localToContent(0,0) -- get absolute position of object offset, even within scrollview local newCenterX = background.x + xOffset local newCenterY = background.y + yOffset field.textField.x = newCenterX field.textField.y = newCenterY end

Maybe some of you guys know a better way to do that.

I’ll check out the widgetstown editfield too.

Just to add to the party, in my own custom solution, I set it up so that if i’m on Windows, it creates a simulated textfield, and lets me use my PC keyboard to enter text. It’s very, very rudimentary, and doesn’t allow selecting text, copying/pasting, or any of that. It’s basically just to make it usable for testing on a Windows PC.  It simply listens for keyboard events and regurgitates it back to the screen.

The two main problems I’m having right now:

  1. Font scaling

  2. Events aren’t firing properly on the device itself; when I’m in the corona simulator, I set up an invisible overlay behind the textfield, so that when you tap out of it, it swaps it back to the newText object instead. This works great in the simulator, and doesn’t work in the iOS simulator or Genymotion (Nexus 7, Android 4.2.2).

By the way, I see a lot of folks going, “Hey, can you try it on [x].”  I understand it’s better to test on a real device, but the Android emulators are pretty good for initial testing. I always felt the Android emulators were too slow to be usable until Genymotion.

If I can ever get things ironed out in my version, I’ll stick it up on github somewhere, even though it’s kinda ugly, so maybe someone can learn *something* from it that could be applied to some of these others…

Thanks,

Dave

I’m really liking the widgetstown edit field control… Good job on that!

There are a few things I really need in order to use it well, though. I’ll PM you so maybe we can talk about it.

Dave

[quote name=“dave.haynes7” post=“262007” timestamp=“1409001381”]There are a few things I really need in order to use it well, though. I’ll PM you so maybe we can talk about it.[/quote] Hi Dave, Thanks for your interest. As I’m no longer that close to the development of this widget I would kindly suggest you to post your suggestions and/or questions at widgetstown.com Regards, Kerem

I’ve been struggling for a week to get a textfield working.  Rob, your solution works decently, except for the font scaling, but even then, it works better than my current one’s font scaling. It’s odd, because I copied yours, and it still doesn’t work the same for me. :slight_smile:

I did notice that yours doesn’t work in a scrollviewer (because the x and y properties of the field don’t actually change when it’s scrolling up/down), so I had to do something like this:

 local function syncFields(event) local xOffset, yOffset = background:localToContent(0,0) -- get absolute position of object offset, even within scrollview local newCenterX = background.x + xOffset local newCenterY = background.y + yOffset field.textField.x = newCenterX field.textField.y = newCenterY end

Maybe some of you guys know a better way to do that.

I’ll check out the widgetstown editfield too.

Just to add to the party, in my own custom solution, I set it up so that if i’m on Windows, it creates a simulated textfield, and lets me use my PC keyboard to enter text. It’s very, very rudimentary, and doesn’t allow selecting text, copying/pasting, or any of that. It’s basically just to make it usable for testing on a Windows PC.  It simply listens for keyboard events and regurgitates it back to the screen.

The two main problems I’m having right now:

  1. Font scaling

  2. Events aren’t firing properly on the device itself; when I’m in the corona simulator, I set up an invisible overlay behind the textfield, so that when you tap out of it, it swaps it back to the newText object instead. This works great in the simulator, and doesn’t work in the iOS simulator or Genymotion (Nexus 7, Android 4.2.2).

By the way, I see a lot of folks going, “Hey, can you try it on [x].”  I understand it’s better to test on a real device, but the Android emulators are pretty good for initial testing. I always felt the Android emulators were too slow to be usable until Genymotion.

If I can ever get things ironed out in my version, I’ll stick it up on github somewhere, even though it’s kinda ugly, so maybe someone can learn *something* from it that could be applied to some of these others…

Thanks,

Dave

I’m really liking the widgetstown edit field control… Good job on that!

There are a few things I really need in order to use it well, though. I’ll PM you so maybe we can talk about it.

Dave

[quote name=“dave.haynes7” post=“262007” timestamp=“1409001381”]There are a few things I really need in order to use it well, though. I’ll PM you so maybe we can talk about it.[/quote] Hi Dave, Thanks for your interest. As I’m no longer that close to the development of this widget I would kindly suggest you to post your suggestions and/or questions at widgetstown.com Regards, Kerem

Amazing, no text input for Windows developers!

I am laughing as I write this… unbelievable.

Just found out that MS Visual Studio is free, so I can go and explore developing with Marmalade.

FYI: I am interested in learning app dev privately. However I work in a corporation (20k+ employees). When we start developing apps, I cannot advocate for Corona. I hope the developers take this seriously - be honest and stop talking about business apps or get serious. 

I feel a little sad though, I like Lua and the feel of Sublime (and I hate VisualStudio) - but guys, seriously. No proper text input…

 I suppose you’re free to laugh.  But Corona SDK is an OpenGL product.  Microsoft does not permit native controls to be in same window as an OpenGL Window.  The lack of text input on Window’s isn’t by choice.  Corona SDK is possible as a cross-platform tool because we have to do as much as we can in a centralized way and that’s Lua and OpenGL.  We may end up having to do more with DirectX on Windows.

Nothing prevents you from doing your testing directly on Android on in an Android emulator.  This is just a limitation on the Corona simulator.

Rob

I realize you don’t omit it by choice but what you can choose are your priorities. Please don’t claim business app development prematurely then.

If there would be an ETA I would at least have a time to check back.

Since the simulator does not behave like a device it’s obviously not a complete simulation of what happens on a device.

It’s hard to understand then, than the newTextField has to behave that badly in the simulator. One thing is that you cannot enter things into them, but if a newTextField (or the grey rectangles that are supposed to look like them) is ever shown, this rectangle is obscuring everything, in all scenes, forever after. Is this really necessary? Is this also happening on the mac simulator?

@runewise, I have struggled with the textfield on Windows as well, but I believe they already answered your question. On Windows, they have limitations that they don’t have elsewhere. So the Windows version of the Corona Simulator has limitations.  I doubt it has to be a grey rectangle, though. I think it might as well just be invisible if it’s unusable anyhow.

On the Mac simulator, you can use text fields just fine.

As an experiment, I created my own simulated textfield for working in the Windows version of Corona Simulator.  I was essentially creating a textbox control from scratch – on tap, it gets the focus; as long as it has the focus, it listens for key events, and shows those keys on the screen in the area designated for my textbox.

My idea was to make it awesome and release it to the Corona community to solve this problem, but I couldn’t ever make it as awesome as I wanted, and I finally just gave up on it once I got CoronaViewer working for my Windows developers.

The windows simulator seems to be an unfinished product. CoronaSDK feels like a iOS centric SDK with a little Android put in. Ok for iOS delveloper - not so ideal for us who only develops for Android (at the time being).

Yes, CoronaViewer could probably solve the problems. I have other issues with CoronaViewer, however, but that does not belong in this thread  :slight_smile:

We work hard to keep the Windows simulator even with the Mac version.  But there are physical limitations between the platforms that simply prevent them from being equal.

Rob

I use Widget Candy to get around this issue.  Widget Candy provides a simulated text input that works on Windows, Mac and your device.   You lose the native keyboard (which is a drag if you like Swype), but it really does help when you’re developing apps in Windows.   Also, by using Widget Candy, you can customize the keyboard (like number pad only).  Just a tip in case this helps.  

guys. ive struggled with this for a year or two. Its not worth it… 

I built a custom MAC. yes legal parts and legal Yosemite OS from the apstore. its very easy and u follow the guides and u can have a dual development pc up and running. 

Nowi im happily using my corona on mac with designer preview!!! its worth it, and the costs are a quarter of buying a mac. email me if you want more tips and info. 

jacksparrow.greg@gmaiil.com

Amazing, no text input for Windows developers!

I am laughing as I write this… unbelievable.