svyKeyListener - Not Working Locally

Hey Guys,

I went up to (the AMAZING) demo.servoy.com and had a look at the svyKeyListener example. COOL.

Downloaded the sample file, downloaded the svyKeyListener into the Web Packages (via the web package manager).

When I open the solution and click the “Add Listener to search field” button - and then start typing - nothing happens.

Also, I noticed the example - it was using the object rather than a string when adding it:

plugins.keyListener.addKeyListener(elements.pw,onKey);

I thought it was supposed to be:

plugins.keyListener.addKeyListener("pw",onKey);

Can anyone suggest where I went wrong? :)

OK - figured it out.

Turns out the DOCS ARE WRONG. You need to specify a component - NOT a string:

THIS:

plugins.keyListener.addKeyListener(elements.fld_key,onKey);

NOT THIS:

plugins.keyListener.addKeyListener("fld_key",onKey);

Hello, I’m new to the forum, how do I do in NGclient to see if the “capslock” key is activated and thus show a message on the login screen?

Thank you!

Juan Pablo
Servoy Version: 8.3.3.3209
SQLServer 2012

Hi Juan Pablo,

First of all welcome to the Servoy forum!

For the NG client there are a lot of components and services which you can install through the Web Package Manager.
(right click the Web Packages node in the solution explorer and select the first option: download/install

In the manager, goto the service section, install the Keylistener service and close the manager.
Now scroll all the way down in de solution explorer and you will find the key listener service as part of the plugins node.

If you didn’t already guess, you will need the keylistener plugin.
It needs to be registered to an element (most likely the password field in this case) at the onShow method of your login form
The callback contains 7 parameters, the last one is ‘capsLock’ which is actually a Boolean value and while typing in your field, it will return either true or false.

The wiki page of the keylistener service has a clear description of what you actually need to do, including code snippets
https://github.com/Servoy/svyKeyListener/wiki

Hope this helps