You can use the modified property.
function my_entry:onChange()
if self.modified then
self.text = string.gsub(self.text, "A", "X")
end
end
Now there is another problem: whenever the text property is set, the cursor position is 0. It seems that this has changed with some update.