Disable showing keyboard on textField tap

Hi. I am making a calc app and I use native TextField to show numbers. Anyway, I have my own digit  buttons, so I don’t need to use native keyboard. Is there anyway to disable it?

I use this, but it shows keyboard for a moment and hides it.

local fieldHandler = function( event )     if (event.phase == "began") then         native.setKeyboardFocus( nil )     end end local textArea = native.newTextField( 0, \_TOP\_+60, 480, 101, fieldHandler  )  

If you are using the native.newTextField as a read-only text display perhaps display.newText() might be a good alternative to use. You will not have to struggle with the keyboard then. See at : 

http://docs.coronalabs.com/api/library/display/newText.html

I tried to use simple text, but it complicated it even more. If I use newText, i should also care about positioning it, when text is changed in right amount of pixels.

So there is no way to do what I want using native text field?

The display.newText() was updated to provide alignment functions. See updated docs at 

http://docs.coronalabs.com/daily/api/library/display/newText.html

This updated version will be in the next public release which is in final testing now I believe (based on posts yesterday by CL staff). So if you hang in in there for a little while I think you can get away with display.newText and using the right align option. 

Many thanks, I’ll use it.

You’re most welcome. Just use it as is now and leave it left aligned. This way you can focus on the rest of your app and then simply add the right alignment code when the time comes. 

Also you can use a font that looks like the LED fonts from calculators etc. Just a thought. Good luck with your project.

If you are using the native.newTextField as a read-only text display perhaps display.newText() might be a good alternative to use. You will not have to struggle with the keyboard then. See at : 

http://docs.coronalabs.com/api/library/display/newText.html

I tried to use simple text, but it complicated it even more. If I use newText, i should also care about positioning it, when text is changed in right amount of pixels.

So there is no way to do what I want using native text field?

The display.newText() was updated to provide alignment functions. See updated docs at 

http://docs.coronalabs.com/daily/api/library/display/newText.html

This updated version will be in the next public release which is in final testing now I believe (based on posts yesterday by CL staff). So if you hang in in there for a little while I think you can get away with display.newText and using the right align option. 

Many thanks, I’ll use it.

You’re most welcome. Just use it as is now and leave it left aligned. This way you can focus on the rest of your app and then simply add the right alignment code when the time comes. 

Also you can use a font that looks like the LED fonts from calculators etc. Just a thought. Good luck with your project.