B4J Question How do you trap the Escape key, ascii 27?

B4JExplorer

Active Member
Licensed User
Longtime User
Hi,

I'm able to trap ordinary keys inside the TextChanged event. And the Enter key, inside the Action event.

But I'm not able to sense when the Escape key is pressed? Is there a specific event that automatically receives the escape key?
 

B4JExplorer

Active Member
Licensed User
Longtime User
The Escape key won't change the text (in the text changed event). Try using the keypressed or keyreleased event instead (example here https://www.b4x.com/android/forum/t...row-keypress-in-a-text-box.76960/#post-487613)
Steve,

Thanks, I already had a keypress event defined, but the Esc key never triggered it. But I just found out the reason - in the AddEventHandler, the event name was spelled wrong; it was cloned from another project, and another event altogether.

Everything's good now, except for a question about programmatically cloning labels (another thread), thanks.
 
Upvote 0
Top