When using an input text field with inputType set to “number” any return key is missing on the device (in this case iPod Touch 4G, iOS 5.0.1). How can one abort the keyboard input process?
[import]uid: 9644 topic_id: 22339 reply_id: 322339[/import]
yeah! i have had the same problem…
I have avoided “number” inputType since then.
Would love to hear a solution though. [import]uid: 64174 topic_id: 22339 reply_id: 89026[/import]
When I’ve done this I’ve added a button next to the textField to use. Could this work in your situation? [import]uid: 52491 topic_id: 22339 reply_id: 89043[/import]
I can’t avoid using the number keyboard in my app. Users need to enter lots of numbers and it would be very uncomfortable for them to use the default keyboard each time.
Unfortunately I can’t use a custom button to terminate the input process (this is due to another Corona bug that does not prevent tap events from being propagated, so they conflict with touch event objects beneath it, long story…)
Having a keyboard on screen with no button to let it disappear again. It feels like a joke o.O
[import]uid: 9644 topic_id: 22339 reply_id: 89047[/import]
[edit]
If your reason for not being able to add your own custom return type button is because of other touch events beneath it being triggered when the return button is closed, you could also add a variable check like isNumOpen = true/false (or even just something like settings the return button’s isVisible property and checking for that) and check to make sure its false on your other touch events and true on the return button. Then when the button is displayed set that variable to true and when the button is pressed set it to false. This way any other touch events under the button may be called, but will not trigger anything while the button is visible.
[edit 2]
Would it also not work to make it so when the user clicks outside of the input box they where entering numbers into, it goes away?
So just something like this:
[code]
local numberField
local function fieldHandler( event )
if ( “ended” == event.phase ) then
native.setKeyboardFocus( nil )
end
end
numberField = native.newTextField( 10, 30, 180, 30 )
numberField.inputType = “number”
numberField:addEventListener( ‘userInput’, fieldHandler )
[/code] [import]uid: 69700 topic_id: 22339 reply_id: 89048[/import]
I found a more or less stable workaround for now, but I really don’t know if this will interfer with any other code sooner or later.
I am working on a module which I’d like to use in other projects, too. Therefore, it should be as independent from any other code and (touchable) objects beneath as possible. The best way to achieve this would be if there would simply be a “return” button on the keyboard that triggers an event, of course -like there is with the normal keyboard.
I just don’t understand why this hasn’t been implemented with the number keyboard, too. This makes no sense at all. There is even an empty button on the number keyboard (at the bottom left) which could be used as a return button -but it has no functionality =( Seems like the responsible programmer had clocked out and forgot where to continue the next day… o.O
[import]uid: 9644 topic_id: 22339 reply_id: 89084[/import]