Ah yes I forgot about that… It takes a lot of code to pretend to be a text field just so it can be styled a bit. It is a shame the framework doesn’t use a similar methodology.
Why is this hard to build an OpenGL text field? If we had a large team of engineers and years to make it, then it might be possible. Several people got a reasonable English only version working after we enabled keyboard handling. But this isn’t going to work on iOS or tvOS since there isn’t key events.
If you’re on a touch screen device, you have to build your own keyboard. Okay easy enough some display.newRect’s and touch handlers, but you still have to build a lot of support around being able to show and hide the keyboard and other things you may take for granted by the native text field.
Regardless, you have to support shift states to get upper and lower case characters. You are going to need to support symbols which is different between Windows and Mac. For English this isn’t bad, but are you going to support other keyboards? French? German? Simplified Chinese? Now the scope of building these keyboards grows by magnitudes. The data we get back is keycodes and shift states. You still have to figure out if someone has a French keyboard and generate the right glyphs. Now factor in right-to-left languages. You have to support that and the rules that go with it. Typematic rates? Editing in-line? Selecting? Copy/Paste?, Shift-Enter to go to a new line?
While individually these are addressable and you personally may not need all of these features, we would have to support them because our product is used internationally by developers and internationally by customers of those developers.
At least three people I know of had a simple English only keyboard working. Jason may have been one of them. But as far as I know all of them were abandoned over some reason or another (based on lack of chatter about it in the forums since their attempts).
As I am on my second Win32 app built using Corona this is something I would absolutely both be interested in as well be ready to pay for. If you have a forum link or anything i can tag to follow i’d love to receive it.
Herb is very kind, and I’m glad the module I made for him is working. I can see myself converting it to a plugin, as Herb has suggested since our first correspondence, but bear with me as it may take a bit longer than you’d think. First I want to finish up the “bells and whistles,” but then turning it from a “one-off” module to a one-size-fits-all plugin will take a while. I’ll need to document it, which takes time, then there is the Corona submission process, which can take some time depending on the number of submissions they are digging through.
tl;dr: plugin is coming but please be patient with me.
@anaqim: yep, that’s basically what I’m doing to create my “fake” input fields. Hiding a native text field that intercepts user input and passes it along to a Corona display object.
Keep in mind that you can’t really edit this. Mobile OS’s allow you to tap and hold inside the string and jump the cursor to that location, you can also select/copy/paste and use handles to manage what’s being selected. This seems to me to not be possible if you can’t touch the physical field.
@rob - you are right, it’s not a perfect solution. But I have put some effort into finding as much of a middle ground as I can, and it’s not so terrible. There are ways of massaging things to retain maximum editability but still prettifying things. For example, you can hide the native input until the user is actively editing, then strategically place it over your OpenGL version.
Again, it’s not a full-stop replacement for native inputs, but I do look forward to making the plugin ready. I think it could prove useful.
I will say, it has been an education discovering all the peculiarities of the various native inputs (MacOS, Windows, iOS, Android, textField vs textBox, etc.) - they all behave just a little bit differently from one another.
By which I mean, kudos to the fellas and ladies at Corona Labs who manage to wrangle all these different platforms into a single SDK that pretty much operates the same on all of them. It boggles the mind. :huh:
For me, this is strictly a win32 app. It’s not meant for mobile and it gives me exactly what I am looking for.
A robust, configurable control that look and feel like the rest of the application.
At edit time, the background shows up for just the field being edited, but it’s not a whole screen of 20 to 30 ugly looking windows textboxes that mar my beautiful looking corona app.
I totally get why this can’t be supported out of the box. It would be a nightmare to support…