Servoy Stuff - Home of all Servoy related stuff!
Plugins
keyListeners
v1.1.1
v1.1.1
Compiled with a Java 1.4 target to allow Servoy 3.5 usage
v1.1
Added support for all types of input fields except IMAGE_MEDIA
- Thanks to John Lugten for notifying
v1.0
First public release
A free plugin (LGPL license) to attach key listeners function on any key event in your Servoy fields (keyPressed, keyTyped and keyReleased).
Currently not web compatible, as it makes use of Swing Component listeners.
Not sure if I will make try to make a Wicket (web client) behavior for this one, since it would make Ajax call to the server for each key typed in the "listened" field, which could take your server down after a while...
Will see if I can use some Throttle behavior to implement this safely.
For now in the web client it will not break though, it will just do nothing and tell you so in the server log.
This plugin has been tested on Servoy 4.1.x developer and client on windows but should work the same in Servoy 3.5.x as well and on all platforms since it is just regular Java.
OK, but what the hell are listeners?
Listeners are any javascript functions that will be triggered by events in the fields, in this particular case keyboard events.
These events are not published by the regular Servoy event system, but available in Java, so this plugin was born to give you access to them in your javascript function.
What can I do with this plugin?
Some examples include:
- to attach a function that will check if the caps lock is down on a password field
- to attach a "default" function to respond to any entered key into a field
- to attach a function that will alter the user's typing, like automatically convert to uppercase for example.
NB: listeners are very powerful, but you will need to release them propertly to avoid any memory leaks, see the example solution to understand how it can be done.
Download packages:
- the signed plugin jar file (rename to keylisteners.jar if necessary then put in your Servoy/application_server/plugin/ folder)
- a simple Servoy example solution (unzip and import)
- the eclipse project (the java sources of the plugin)
There is now a companion Google-Code project where you will be able to submit issues/feature requests and check out the code from SVN
If you like this plugin, consider donating to help me make more cool stuff available!
You can send me a note with any comment, feature request, bug report, using the contact form.
