Have anyone made software keyboard on moai?

Discussion about using Moai SDK - post questions, bugs and issues here.

Moderators: seebs, franciscotufro

Have anyone made software keyboard on moai?

Postby kengo.nakajima » Thu Jan 12, 2012 5:28 pm

Hi, now I want to implement text-input for getting player name and password on moai.

I want the same Lua code work on PC(win/mac) and iOS.



In Moai, I think we have to implement software keyboard on Lua.

I am now searching for a product someone made already.

Otherwise I have to write it and it'll take some days..



Do you have any information about software keyboards?

Or another solution on inputting text on Moai?
kengo.nakajima
 
Posts: 56
Joined: Wed Jul 27, 2011 3:20 pm

Have anyone made software keyboard on moai?

Postby anddrewscott » Fri Jan 13, 2012 2:22 am

By soft keyboard do you mean virtual? 
This is available to Corona SDK users, it is used for testing on their simulator (no iPod native on it), but is unnecessary for device builds.
anddrewscott
 
Posts: 153
Joined: Fri Sep 02, 2011 7:39 am

Have anyone made software keyboard on moai?

Postby eric » Fri Jan 13, 2012 4:11 am

We have a software keyboard in our in house game, Wolf Toss. The most time consuming part was layout - which we had an artist do in Photoshop. The artist was then able to give screen coordinates of all the buttons to our scripter who was implementing the keyboard - saving us lots of time. Once everything is laid out, the code to support the keyboard came together in a couple hours with a few pages of code.



I would recommend starting simple and expanding from that if you need something better. For example, a simple table with the keys' character and position provided dual use for us. We looped through it during button creation to get the positions and character to display on the button as well as being used to retrieve the character when a button was hit.


...

[ 11 ] = { x = 95, y = -305, char = "q" },

[ 12 ] = { x = 175, y = -305, char = "w" },

[ 13 ] = { x = 255, y = -305, char = "e" },

[ 14 ] = { x = 335, y = -305, char = "r" },

[ 15 ] = { x = 415, y = -305, char = "t" },

[ 16 ] = { x = 495, y = -305, char = "y" },

[ 17 ] = { x = 575, y = -305, char = "u" },

[ 18 ] = { x = 655, y = -305, char = "i" },

[ 19 ] = { x = 735, y = -305, char = "o" },

[ 20 ] = { x = 815, y = -305, char = "p" }, 

...


When we create the props for the buttons, we associate them with an index in this table. Therefore, when we check if the prop was hit during an 'up' touch event, we can add the correct character to our buffer. So the basic update loop will check the touch position against our table of props ( through a loop ). If one is hit, we lookup the proper character and add it to the buffer. That is really all it takes! From there you can add complexity on top, such as implementing character limits, scaling buttons or switching art index on press, etc. 
eric
 
Posts: 39
Joined: Mon Aug 08, 2011 10:55 am

Have anyone made software keyboard on moai?

Postby anddrewscott » Fri Jan 13, 2012 7:07 am

anddrewscott
 
Posts: 153
Joined: Fri Sep 02, 2011 7:39 am

Re: Have anyone made software keyboard on moai?

Postby backroll » Wed Jan 18, 2012 5:25 pm

I'm new here, but if I'm reading this correctly, does that mean moai has no way to receive text input on mobile devices? No way to use the built-in keyboards?
backroll
 
Posts: 3
Joined: Fri Aug 12, 2011 11:32 am

Re: Have anyone made software keyboard on moai?

Postby kengo.nakajima » Wed Jan 18, 2012 6:08 pm

as far as i know, it doesn't have it. roadmap?
I imagine we could use virtual keyboards like existing MOAIApp.showDialog(), and get text by callback function!
kengo.nakajima
 
Posts: 56
Joined: Wed Jul 27, 2011 3:20 pm

Re: Have anyone made software keyboard on moai?

Postby patrick » Thu Jan 19, 2012 8:43 pm

@backroll We haven't exposed the native software keyboard but it should be easy to add via MOAIApp just as Kengo suggests. So I wouldn't say there's 'no way' - Moai is open source, so there's always a way. :) You'd just need to add a method to display the keyboard and a callback to return the text. A fancy implementation would also return the size of the keyboard and add an animation callback. If you want to implement it, send me a pull request I'll merge it in. If not, it should be in by 1.0.
User avatar
patrick
 
Posts: 589
Joined: Sat Apr 02, 2011 10:50 pm

Re: Have anyone made software keyboard on moai?

Postby Souledge » Fri Mar 23, 2012 2:49 pm

Hello, congratulations on MOAI V 1 release.
I was wondering if this is resolved and included in the V1.0 as of today's release.
Souledge
 
Posts: 4
Joined: Fri Mar 23, 2012 2:47 pm

Re: Have anyone made software keyboard on moai?

Postby patrick » Fri Mar 23, 2012 9:11 pm

Not yet. Soon(tm).
User avatar
patrick
 
Posts: 589
Joined: Sat Apr 02, 2011 10:50 pm

Re: Have anyone made software keyboard on moai?

Postby Souledge » Sat Mar 24, 2012 12:13 am

patrick wrote:Not yet. Soon(tm).


Hello Patrick =)
Thank you for your response, do you have any idea on the time frame of this? 1 month, 2 months? The reason I need to know is because this in addition to the Chinese / Asian text greatly affect our decisions in whether Moai would be the suitable pipeline for our upcoming project. Thank you for your understanding.
Souledge
 
Posts: 4
Joined: Fri Mar 23, 2012 2:47 pm

Re: Have anyone made software keyboard on moai?

Postby mikegriffin » Sun Mar 25, 2012 11:14 am

mikegriffin
 
Posts: 68
Joined: Thu Feb 02, 2012 12:04 pm

Re: Have anyone made software keyboard on moai?

Postby patrick » Sun Mar 25, 2012 11:03 pm

@mikegriffin Very nice!

@Souledge Will aim to support native software keyboard within a month.
User avatar
patrick
 
Posts: 589
Joined: Sat Apr 02, 2011 10:50 pm

Re: Have anyone made software keyboard on moai?

Postby Souledge » Mon Mar 26, 2012 2:44 am

Awesome guys! Thank you.

@mikegriffin Thank you Mike for your contribution, it's greatly appreciated!

@Patrick Thank you Patrick! =) Just one last question regarding this topic: We now know that Chinese and other asian texts can be displayed, do you have any plans to support Chinese and other asian text typing using the keyboard? Are there any chat system being on the agenda? The reason is because in the asian market, games are usually under the freemium model, so in order to profit, micro-transaction is essentially vital to success, and as we all know with micro-transaction comes with on-line multiplayer interaction and social media integration. With that, it's only natural to assume that people would want to chat and communicate with their friends inside the game with their default localized language =) If this is also on the agenda, do you know the time-frame? Thank you Patrick for your awesome work and support, keep rocking and keep rolling =)
Souledge
 
Posts: 4
Joined: Fri Mar 23, 2012 2:47 pm

Re: Have anyone made software keyboard on moai?

Postby patrick » Mon Mar 26, 2012 9:37 pm

Good question. Chat would be a Moai Cloud thing. I will ask Rob tomorrow. Re Asian language support, absolutely. We'll be wrapping the phone's native keyboard so it should work under whatever locale the phone uses.
User avatar
patrick
 
Posts: 589
Joined: Sat Apr 02, 2011 10:50 pm

Re: Have anyone made software keyboard on moai?

Postby thebullno1 » Wed Mar 28, 2012 1:47 pm

MOAIKeyboardSensor is already there but the returned value is arbitrary for now. I think it's time for Moai to give some sort of specification for host implementers to ensure that the same lua code can work across different hosts.
User avatar
thebullno1
 
Posts: 256
Joined: Sat Jul 02, 2011 8:53 am

Re: Have anyone made software keyboard on moai?

Postby patrick » Thu Mar 29, 2012 10:55 am

That's a good idea as well. I remember we talked about that early on but it fell through the cracks. Will open an issue for it...
User avatar
patrick
 
Posts: 589
Joined: Sat Apr 02, 2011 10:50 pm

Re: Have anyone made software keyboard on moai?

Postby rob » Sat Mar 31, 2012 3:20 pm

We don't have a specific chat feature on the agenda, but we do have some basic building blocks that would allow for the easy development of a chat feature. Once that is in place I could easily see us creating a Moai Direct Chat service. The timeframe for it isn't set yet, but it is moving up our priority list. If it's something you are interested in provide some feedback for it on our features page.

https://moaicloud.uservoice.com/forums/137991-features
rob
 
Posts: 116
Joined: Wed Sep 21, 2011 2:34 pm

Re: Have anyone made software keyboard on moai?

Postby kaykim » Thu May 17, 2012 10:25 pm

This is friendly reminder of supporting native software keyboard.

I was wondering if you shared any update on the time frame with us.

patrick wrote:
@Souledge Will aim to support native software keyboard within a month.
kaykim
 
Posts: 32
Joined: Mon Feb 27, 2012 7:17 am
Location: Seoul, Republic of Korea

Re: Have anyone made software keyboard on moai?

Postby ibisum » Fri May 18, 2012 12:42 am

I don't get it .. I'm already using MOAIKeyboardIOS.getText() .. is this not what you guys need too?

Code: Select all
  1.  

  2. function oniOSKeyInput ( start, length, text )

  3.   print ( start, length, text )

  4.   user_entered_text = MOAIKeyboardIOS.getText ()

  5.   print ( user_entered_text )

  6. end

  7.  

  8. function oniOSKeyReturn ()

  9.   user_entered_text = MOAIKeyboardIOS.getText ()

  10.   print ( user_entered_text )

  11. end

  12.  

  13. if MOAIKeyboardIOS then

  14.     MOAIKeyboardIOS.setListener ( MOAIKeyboardIOS.EVENT_INPUT, oniOSKeyInput )

  15.     MOAIKeyboardIOS.setListener ( MOAIKeyboardIOS.EVENT_RETURN, oniOSKeyReturn )

  16. end

  17.  

  18. -- for development on MacOSX

  19. if MOAIInputMgr.device.keyboard then

  20.     MOAIInputMgr.device.keyboard:setCallback(onKeyboardEvent)

  21. end

  22.  




EDIT: Just noticed that this is only working on iOS, and not Android. Alas, MOAIKeyboardAndroid would be really nice to have as well ..
;
--
ibisum@gmail.com
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info
User avatar
ibisum
 
Posts: 1004
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: Have anyone made software keyboard on moai?

Postby kaykim » Sat May 19, 2012 4:34 am

Yes, that's the problem I have. I'm going to use Facebook, Google and Twitter for Authentication, but Moai doesn't support keyboard for Android yet. :)

ibisum wrote:I don't get it .. I'm already using MOAIKeyboardIOS.getText() .. is this not what you guys need too?

EDIT: Just noticed that this is only working on iOS, and not Android. Alas, MOAIKeyboardAndroid would be really nice to have as well ..
kaykim
 
Posts: 32
Joined: Mon Feb 27, 2012 7:17 am
Location: Seoul, Republic of Korea

Next

Return to Moai SDK

Who is online

Users browsing this forum: No registered users and 1 guest

x