handle the Apple (command) key with Servoy on Mac OS X

Questions, tips and tricks and techniques for scripting in Servoy

handle the Apple (command) key with Servoy on Mac OS X

Postby Harjo » Thu Jul 01, 2010 8:53 pm

I want to create a shortcut key command by using the windows plugin.

because I hide all the menu's I dont have CTRL-F (windows) & Apple-F (apple) anymore
So I have this now: plugins.window.createShortcut('control F', 'globals.core_onFind');

which works fine, but how do I create the shortcut: Apple-F for Apple?
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: handle the Apple (command) key with Servoy on Mac OS X

Postby IT2Be » Thu Jul 01, 2010 9:36 pm

If I am not mistaken the apple key is the 'command' key...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: handle the Apple (command) key with Servoy on Mac OS X

Postby Harjo » Thu Jul 01, 2010 10:07 pm

So

plugins.window.createShortcut('command F', 'globals.core_onFind');

should work?

do I really need to create 2 two shortcuts? one for windows? one for Apple? or can this be done in one call?
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: handle the Apple (command) key with Servoy on Mac OS X

Postby IT2Be » Thu Jul 01, 2010 10:14 pm

again, if I remember well, command can be used for 'apple' on mac and 'control' on win. Just try and see :)
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: handle the Apple (command) key with Servoy on Mac OS X

Postby rgansevles » Mon Jul 05, 2010 2:37 pm

Harjo,

I think the command key on the mac is called meta in java keystroke terms.
When you use 'menu' in the window plugin, on the mac it will translate to 'meta' and on the rest to 'control'.

plugins.window.createShortcut('menu F', 'globals.core_onFind');

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

Re: handle the Apple (command) key with Servoy on Mac OS X

Postby swingman » Mon Jul 05, 2010 5:25 pm

What are the left and right arrow keys called?
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1479
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: handle the Apple (command) key with Servoy on Mac OS X

Postby rgansevles » Mon Jul 05, 2010 6:14 pm

Christian,

In the sample code of the createShortcut method you can find a reference to
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/KeyStroke.html#getKeyStroke(java.lang.String)

This tells you that key code name is the the name following "VK_" in the constants definitions which are defined here:
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/KeyEvent.html

So, the right arrow key is called RIGHT, right?

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


Return to Methods

Who is online

Users browsing this forum: No registered users and 7 guests