Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiSetBindKey

hiSetBindKey(
[ t_applicationType ] 
[ t_key ] 
[ t_skill_cmd ] 
) 
=> t / nil 

Description

Binds a SKILL command string to a keyboard key or a mouse sequence for an application.

Before setting bindkeys, the application should be registered either through deRegApp or hiRegisterBindKeyPrefix. Cadence applications are already registered. You can get a list of registered bindkey prefixes for applications that you are running with the hiGetBindKeyPrefixList function or the Key or Mouse Binding form (choose Options – Bindkeys in the CIW to get the form).

If the t_applicationType or t_key arguments are not specified, a bindkey form is displayed.

Arguments

t_applicationType

Any user-definable string that has been registered through hiRegisterBindKeyPrefix or a Cadence application type. You can get a list of registered bindkey prefixes for applications that you are running with the hiGetBindKeyPrefixList function or the Key or Mouse Binding form.

If this argument is not specified, a bindkey form is displayed.

t_key

String specifying the key sequence, the operator, detail, and occurrences. If not specified, a bindkey form is displayed. Items in this list are:

  • modifier_list (optional)
  • operator
  • detail (optional)
  • occurrences (optional)

If t_key ends with EF, the SKILL command is used in enterfunction mode. Otherwise, it is a non-enterfunction mode command. If there is no enterfunction mode command defined when a key or mouse event happens in enterfunction mode, the non-enterfunction mode command for this key is used.

Defining an empty string for a command is the equivalent to not defining the command in the first place. A bindkey defined for an alias application that has an empty string for the command, will inherit from the root application. If an enterfunction command is defined as an empty string, then the non-enterfunction command will be used.

When using an enterfunction in an alias application, the enterfunction binding for the alias application will be checked first, then, if that is not defined, the enterfunction binding for the root application will be checked. If that is not defined, then the non-enterfunction binding for the alias application is checked, finally followed by the non-enterfunction binding for the root application.

For more information, see Additional Information.

t_skill_cmd

SKILL function to be executed with the translation in t_key. If you wish to specify more than one function, separate each one with a space. If a function is not specified, a bindkey form is displayed.

The maximum string length for the SKILL command is 511 characters. If multiple commands are to be executed, it is recommended to define a SKILL procedure and call the SKILL procedure rather than coding the entire procedure into the bindkey command string.

To unset a previously set bindkey, you can set the t_skill_cmd to "". This is the equivalent to not defining a command in the first place.

Examples

The following are examples of various key bindings:

"Shift<Key>F2"  (Shift key + F2 key)
"Ctrl Shift<Key>Escape" (Control key + Shift key + Esc key)
"<Key>3"   (3 key)

When setting a bindkey to the comma key, spell out the word comma rather than using the comma character (,).

"<Key>comma"
"Shift<Key>comma"Value Returned"

Binds the Command Interpreter application with hiQuit using the bindkey None<Key>F6:

hiSetBindKey("Command Interpreter" "None<Key>F6" 
"hiQuit( )")
=> t

Binds the Schematics application with hiZoomIn using the bindkey Shift<Key>z:

hiSetBindKey("Schematics" "Shift<Key>z" 
"hiZoomIn(hiGetCurrentWindow( ))")
=> t

Binds the Schematics application with hiEditPropList using the bindkey Shift<Key>s:

hiSetBindKey("Schematics" "Shift Ctrl<Key>s" 
"{println(\"Editing selected object \")
hiEditPropList(car(geGetSelectedSet( )))}")
=> t

Binds the Schematics application with mouseAddPt using the bindkey None<Btn1Down>EF:

hiSetBindKey("Schematics" "None <Btn1Down> EF"
"mouseAddPt( )")
=> t

Binds the Schematics application with hiZoomIn using the bindkey <DrawThru3>:

hiSetBindKey("Schematics" "<DrawThru3>" "hiZoomIn( )")
=> t

Binds the Schematics application with hiUnselectTextAll using the bindkey <Key>F8:

hiSetBindKey("Show File" "<Key>F8" 
"hiUnselectTextAll(hiGetCurrentWindow())")
=> t

Additional Information

To define no action for a binding and stop inheritance, specify the string nil for t_key.

Use t_key in the following syntax:

“modifier_list<operator>detail(occurrences)”

Use the hiBindKeyModifiers functions to get a list of legal modifiers for your session. The following modifiers could be in that list:

All modifiers except Ctrl and Shift will be checked to ensure they are assigned to keys on the current keyboard. A warning message will be issued, and the bindkey will not be defined for any modifier that is not assigned to a keyboard key. The Ctrl and Shift modifiers are guaranteed to be assigned. The Caps Lock key cannot be specified as a modifier. Alt can be specified only with function keys and mouse bindings, not with printable characters (unless menu access keys are disabled.)

An exclamation point or a tilde is illegal in a bindkey string.

If None is specified, it means no modifiers can be asserted. This is also the equivalent of having no modifiers.

None <event> detail
<event> detail

These following operators are supported by t_key:

Related Topics

Bindkey Functions

hiBindKeyModifiers

hiGetBindKeyPrefixList

hiRegisterBindKeyPrefix


Return to top
 ⠀
X