Android, Nifty, and Keyboards/Text Controls

Hi all,



Has anyone tried using the nifty text controls on android? i.e. allowing players to type into the screen.



I’ve created a nice fancy animated layout and it runs nicely and I can click on buttons and select text areas etc. However not having a keyboard attached I can’t actually type into them.



Is this something anyone has tried or is working on yet?



Thanks,

Zarch

There’s a change that’s been submitted to include the ability to have the Android system pop up a EditText and the Android OS soft keyboard. Just waiting for it to be checked into SVN.



http://hub.jmonkeyengine.org/groups/android/forum/topic/nifty-textfield-on-android/



This will work for Nifty TextFields. Is that what you are using?

2 Likes

It is indeed exactly what I’m using, I just had a read through that thread and it seems very promising indeed. Using the soft keyboard is a good idea since as mentioned in the thread it means you read user preferences such as azerty etc automatically and also



Incidentally my first thought for doing an on-screen keyboard inside nifty was that I wouldn’t try and layout the whole keyboard. Instead I’d provide a bitmap which is the keyboard and gets scaled appropriately and map the mouse X/Y co-ordinates to see which keys are clicked. Then a simple file defining the keymappings (could be as simple as a text file containing:

qwertyuiop

adfghjkl

zxcvbnm

Maybe with some offsets or similar settings for each row - in this example 22% y, 50%x would give you t.

I just committed the patch, it should be available in next nightly build.

1 Like

Thanks Nehon, any idea when the next release will be?



(I definitely need this feature, but I can survive without it for a few weeks so if there is a release coming soon then I’ll wait for that - if not then I’ll pick up the daily build when the time comes).



Thanks,

Zarch