event.getModifiers no WebClient compatibility ?

Forum to discuss the Web client version of Servoy.

event.getModifiers no WebClient compatibility ?

Postby stefanoni » Mon Oct 11, 2010 12:36 pm

I searched the http://wiki.servoy.com/display/public/DOCS/Web+Client+compatibility+overview
It says nothing about event.getModifiers().

But it seems not to work with (for example) a Shift-click on a button:
In the globals.onAction(event) my first statement is if(event.getModifiers()==17), but
it only works with the smartclient.

Any suggestions about this ?
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: event.getModifiers no WebClient compatibility ?

Postby rgansevles » Mon Oct 11, 2010 3:05 pm

Alessandro,

The modifiers are a bit-pattern, so if you want to check if the shift key was pressed, check the modifier bit like this:
Code: Select all
if ((event.getModifiers() & JSEvent.MODIFIER_SHIFT) != 0)
{
   application.output("shift")
}

This works both in smart and web client.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: event.getModifiers no WebClient compatibility ?

Postby stefanoni » Tue Oct 12, 2010 8:54 am

rgansevles wrote:The modifiers are a bit-pattern

That was it. I now understand and it works fine in web and smartclient.
Thanke you Rob !
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 11 guests

cron