piShortCutKey - cCJAction
Assigns a Codejock maintained shortcut key to an item action
Type: Property
Access: Read/Write
Data Type: FoldedInteger
Parameters: None
Parameters
| Parameter | Type | Description |
|---|---|---|
| iExtra | Integer |
Syntax
Property FoldedInteger piShortCutKey
| Access Type | Syntax |
|---|---|
| Read Access: | Get piShortCutKey to FoldedIntegerVariable |
| Write Access: | Set piShortCutKey to FoldedIntegerVariable/Value |
Description
piShortCutKey is used to bind a shortcut key to an action. When bound, this shortcut key will invoke the action when pressed. If the action is disabled, the shortcut will also be disabled.
Two integer parameters are passed to bind the shortcut key, an extra key (Ctrl, Alt and/or Shift) and the main key:
Hi value (Extra Key): Any extra key pressed, which can be any combination of Ctrl, Alt, or Shift.
Valid values:
| Constant | Meaning |
|---|---|
| xtpKeyNone | no extra key is pressed (0) |
| xtpKey_Shift | Shift key is pressed |
| xtpKey_Ctrl | Ctrl key is pressed |
| xtpKey_Alt | Alt key is pressed |
Extra keys may be combined (e.g. xtpKey_Shift + xtpKey_Ctrl)
Low value (Main Key): The main key represented as a virtual key (e.g., VK_1 - VK_9, VK_A - VK_Z, VK_F1 - VK_F12)
One folded parameter is returned with the extra key in the hi() value and the regular key in the low() value.
The default value is no shortcut key (0, 0).
Sample
Object oMyMenuItem is cCJMenuItem
Set psCaption to "Select Me"
Set psToolTip to "Select Me in tooltip"
Set psDescription to "Select Me in idle statusbar pane"
Set psImage to "SelectMe.ico"
Set piShortCutKey to xtpKey_Ctrl VK_S
Procedure OnExecute
Showln "Select Me was selected"
End_Procedure
End_Object
Important
The Codejock key binding works independently from the DataFlex On_Key binding. You should only use one or these binding for an action as combining the two will cause undefined behaviors.
If you are using the DataFlex On_Key bindings you will not use this property. If you wish to assign shortcut key text to appear in a popup menu item you will set the text value using the psShortCut property.
If you do use the piShortKey bindings you will not use the psShortKey property and you should not use the On_Key command. When used in this fashion, you can choose to display the shortcut value automatically by setting the cCJCommandBarSystem pbToolBarAccelTips property to true.
Currently none of the cCJMenuItem sub-classes use the piShortCutKey bindings, they use the On_Key bindings that are already built into the data entry classes and the framework.
See Also