How to assign a method to keyboard combinations?

Presently in our FMP solution we assign redundant tasks that cannot be automated to keyboard commands. We think in Servoy we will also have this need on a form-by-form basis. Example: “ctrl + 5”

Thank you.

Hi Tony,

Do you mean something like this…

//get the last key modifiers of last action
( shift = 1,ctrl = 2,meta = 4,alt = 8 )

var m = application.getLastKeyModifiers();
if ( m == 1 ) //shift
{
..script1
}
else if( m == 3 ) //shift+ctrl
{
…script2
}

We’ll have to try it.

Thanks!

Tony_Adrian:
We’ll have to try it.

Thanks!

IMPORTANT NOTE: The application.getLastKeyModifiers() is a Servoy 1.1 feature.

:wink:

Bob Cusick

Will it be possible in the next-release to link a key-combination directly to a method? For example ALT-T or CTRL-K will launch a specific method!

Oh am I glad you asked that! One of the sweetest new features of 1.1 is the ability to execute Methods after keyboard commands.

List includes:…

onSortComd
onShowAllRecordsCmd
onShowOmittedRecordsCmd
onPrintPreviewCmd
onNewRecordCmd
onFindCmd
onDuplicateRecordCmd
onDeleteRecordCmd
onDeleteAllRecordsCmd

Please DO note that it is not yet possible to assign custom keystrokes to specific methods, that functionality did not make it into 1.1 but is still on the requested features list.

The possibilities with this functionality are endless!!

Great work Dev Team