Runtime listener for detecting "key" events works with TextField on simulator but not working iOS device?

I’m writing a little project that detects “key” events from the soft keyboard that is brought up when entering into a text field. I’ve been testing it by updating the .text property of a text object to reflect event.keyName. When I type “y”, it updates the object on the display perfectly in the simulator. When I deploy it to my iPhone 6, it doesn’t update the text object.
 

Here’s what I have:

local keyp = display.newText(“initialized…”, display.contentCenterX, display.contentCenterY, nil, 30)

local function detectKey(event)

        keyp.text =event.keyName

end

typingArea = native.newTextField(display.contentWidth*.05, display.contentHeight*.3, display.contentWidth*.8, display.contentHeight*.05)
typingArea.anchorY = 0
typingArea.anchorX = 0

Runtime:addEventListener(“key”, detectKey)

Running the above code in the simulator works great. On the device, not so much. Any ideas?

David

“Bueller? Bueller?”

https://docs.coronalabs.com/api/event/key/index.html#ios

RATS…well, that explains that. Does anyone know of any other way I can determine if the DELETE key on the iOS soft keyboard was typed and update a text object on the screen? I thought “/b” would do the trick, but it doesn’t seem to work either.

You’re best bet is to style a native.newTextField() to look like what you want the editable text to be and hide it’s background so it blends in with the rest of your UI.  If the keyboard is visible, it’s only going to type into the native.newTextField() it’s focused to.

Rob

“Bueller? Bueller?”

https://docs.coronalabs.com/api/event/key/index.html#ios

RATS…well, that explains that. Does anyone know of any other way I can determine if the DELETE key on the iOS soft keyboard was typed and update a text object on the screen? I thought “/b” would do the trick, but it doesn’t seem to work either.

You’re best bet is to style a native.newTextField() to look like what you want the editable text to be and hide it’s background so it blends in with the rest of your UI.  If the keyboard is visible, it’s only going to type into the native.newTextField() it’s focused to.

Rob