[FREE] Detect the ENTER or DONE key

ActionListener Extension

Hello there, today I’m introducing the ActionListener extension, designed to enhance your Android apps with virtual keyboard event detection and handling. This extension allows you to capture various keyboard actions such as pressing the “Enter/ Done”, “Search” and “Go” keys within a text field. It even lets you define custom actions for additional virtual keys. With the latest update, we’ve added the ability to detect multi-touch events, providing you with information about the number of touches and whether a touch event occurred. This extension is invaluable when you want to add specific keyboard functionalities and multi-touch capabilities to your Android apps created in Kodular.

Features

With the ActionListener extension, you can:

  • Register a text listener on a TextBox to detect and handle virtual keyboard events, including actions like pressing the “Enter,” “Search,” and “Go” keys.
  • Easily clear the text in a TextBox, providing a clean slate for user input.
  • Receive events triggered when supported keyboard actions are performed, giving you control over your app’s behavior.
  • Detect multi-touch events and receive information about the number of touches and whether touch events occurred, enabling you to create more interactive and responsive apps.

Blocks

Use the “RegisterTextBox” block to set up a text listener on a TextBox.
component_method_reister_textbox

The “ClearText” block allows you to clear the text in a TextBox.
component_method_clear_text

Register the screen
component_method_registerScreen

Register the component
component_method_registerComponent

Component to capture multi-touch. Use the MultiTouch event!
component_method_registerMultiTouch

Component to record the number of touches on the screen
component_event_multiTouch

Event to catch screen touches. Need to activate with ScreenTouched
component_event_screenTouched

Event to catch touches on a component. Need to activate with ComponentTouched
component_event_touched

The “TextChanged” block triggers an event when a supported keyboard action is performed. Does not work with multi lines!
component_event_text_change

Example

Note: You cannot call the RegisterScreenTouched, RegisterTextBox, RegisterMultiTouch and RegisterComponentTouched methods at the same time, but only

Extension Details

  • Extension Size: 12.6 KB
  • Package: io.kodular.actionlistener

Download

You can download the extension AIX file:
io.actionlistener.aix (12.5 KB)

If you find this extension helpful and wish to support its development, you can make a donation here. Every contribution, starting from $2, goes a long way in sustaining further development.

Example Project

If you’d like to explore how the ActionListener extension works in practice, you can download the example AIA file (134.4 KB):
ActionListener.aia (131.3 KB)

Source [java]:

Permission to use the provided .java file is granted to anyone under the condition that the original author’s attribution is retained. Feel free to use and modify the file for your own projects, but please acknowledge the original author in your work.

Author: Francisco Iago Lira Passos.
Version 2
ActionListener.java (8.5 KB)

:warning: Your support is crucial for our ongoing mission. By donating, you can help us continue delivering budget-friendly solutions to our community.

Support

:telephone_receiver: If you have questions or need assistance, you can reach us on Telegram.

Thank you for supporting us on this exciting journey! :rocket:

14 Likes

Good working
Nice extension :+1::+1:

1 Like

Thank You!

can u make touch event extension
onInterceptTouchEvent

1 Like

I implemented it in the extension. You can register a component, except Screens, and you can capture the touch coordinates and the event (numeric). Wait for the update!

1 Like

i want by pass touch to under layer …if touch on view layer will be touch bottom layer

2 Likes

Updated extension! I will release a new version with multitouch…

1 Like

Can I use this addon to zoom in and zoom out a canvas image Using two fingers

1 Like

try the Scale Detector extension from here MIT App Inventor Extensions

ScaleDetector
Adds as multitouch scale gesture detector to a Canvas. See Using App Inventor extensions to implement multitouch for an explanation of how this works.

Taifun

1 Like