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