svyKeyListener - Not Working Locally

Forum to discuss the new web client version of Servoy.

svyKeyListener - Not Working Locally

Postby bcusick » Sat Sep 08, 2018 10:18 pm

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:

Code: Select all
plugins.keyListener.addKeyListener(elements.pw,onKey);


I thought it was supposed to be:
Code: Select all
plugins.keyListener.addKeyListener("pw",onKey);


Can anyone suggest where I went wrong? :)
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Re: svyKeyListener - Not Working Locally

Postby bcusick » Mon Sep 10, 2018 10:51 pm

OK - figured it out.

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

THIS:
Code: Select all
plugins.keyListener.addKeyListener(elements.fld_key,onKey);


NOT THIS:
Code: Select all
plugins.keyListener.addKeyListener("fld_key",onKey);
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Re: svyKeyListener - Not Working Locally

Postby desarrollo1534423715 » Thu Jun 06, 2019 2:13 pm

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
desarrollo1534423715
 
Posts: 4
Joined: Thu Aug 16, 2018 2:48 pm

Re: svyKeyListener - Not Working Locally

Postby mboegem » Thu Jun 06, 2019 11:33 pm

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
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 4 guests