Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SeventeenApplication Integration Functions (continued)

QuickKeyRegister Function

Overview

The QuickKeyRegister function sets a quick key hook for a specific view.

Syntax/Parameters

Syntax

int = QuickKeyRegister ( string view, string parameters[] );

int = QuickKeyRegister ( string view, string key, string function,
                     [string description], [string types] );

Parameters

view

A string, specifying the view name to apply the quick key.

parameters

A string array contain the parameters, or,

key

A string containing a function code as a key code. For example, “1_KEY_CONTROL”.

function

A string specifying the function code to run when the key is pressed.

description

An optional string specifying an internal description. This can be used to help organize quick keys.

types

An optional string specifying file types for which the quick key applies. If omitted or empty, all types apply. Up to 6 types may be added separated by spaces.

Return Value

An int as ERROR_NONE (0) or a formatted error code. Depending on the context and environment from which the script is run, an ERROR_FUNCTION_NOT_SUPPORTED code may be returned. The sub codes are as follows:

1 – Engine does not have a menu.

2 – The hosting application does not support application DLL control.

3 – The requested view name or view DLL could not be located.

If the key or function cannot be located, an ERROR_SOFT will be returned with the following sub codes:

1 – The key code is invalid.

2 – The function code is invalid.

On no error, the last error will contain the number of items deleted to succeed in adding the item. For example, if a single key item is added that conflicts with a key chord group, the entire group will be deleted. If there were five combinations, then the return value will be 5.

Remarks

Not all views support quick key adjustments. A key for a function can be changed by replacing the key for a specified function. Note that the ribbon and menu key will not automatically change.

The views that support quick key programming are as follows:

Data View

Page View

Text View (Code View)

When using parameters as an array, the keys must be named as follows:

  Key Name   Description  
  KeyCode   A string translation of the key ID.  
  FileTypeStrings   A series of optional file type strings that must match for context. If blank, the file type is not used.  
  ChordDisplay   If this represents that first in a series of chords, the textual description as displayed on the application’s status bar.  
  ChordKey   The key, as a hexadecimal character or just a character, that is used for a chord. 0x00 represents that it is not a key chord.  
  FunctionCode   A string version of the menu function code to translate the key match.  
  CallerData   Optional caller data.  
  Description   Optional description of the quick key.  
  Source   The source of the key, if loaded as a default key from the application, the value will be the name or filename of the script. Generally, this is used to help identify how the key was defined.  

 

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE