|
|
|
|
|
- Managing all the keyboard keys
ShortcutKey (Property) In french: ToucheRaccourci
The ShortcutKey property gets and sets the keyboard shortcut associated with a control or menu option.
EXTERN "KEYCONST.wl"
BTN_BUTTON1.ShortcutKey = skControl + skShift + Asc("U")
BTN_BUTTON1.ShortcutKey = skControl + VK_F1
EXTERN "KEYCONST.wl"
OPT_Manage_Suppliers..ShortcutKey = VK_F2
OPT_Manage_Users..ShortcutKey = skAlt + Asc("U")
Syntax
Getting the keyboard shortcut associated with a control or menu option Hide the details
<Result> = <Element used>.ShortcutKey
<Result>: Integer Shortcut key associated with the control. <Element used>: Control name Name of element used: - Name of a control,
  Name of a menu option.
Changing the keyboard shortcut associated with a control or menu option Hide the details
<Element used>.ShortcutKey = <New shortcut>
<Element used>: Control name Name of element used: - Name of a control,
  Name of a menu option.
<New shortcut>: Integer constant Shortcut key associated with the control. This key can correspond to one of the following elements or to a combination of the following elements: - Control keys:
| | skAlt | Alt key. | skControl | Ctrl key. | skShift | Shift key. |
- Specific control keys: Additional constants are available in the file "KeyConst.wl".. These constants are used to identify all the keyboard keys. This file is available in the "Personal\External" subdirectory of WINDEV or WINDEV Mobile.. For more details, see remarks.
- Character keys: Simply use the character's ASCII code (obtained with the Asc function).
Remarks Managing all the keyboard keys To manage all the keys with the ShortcutKey property: - Include the KeyConst.WL file in your project. This file associates a specific constant with each keyboard key. This file is available in the \Personal\Extern directory of WINDEV. To include this file in your applications, you need to use the EXTERN keyword as follows:
- Use the constants in the ShortcutKey property:
cControl is Control <- ControlCreate("BTN_Button", typButton, 6, 60, 160, 30, false)
cControl.ShortcutKey = skAlt + skShift + VK_F10
Remarks: - To manage character keys, simply use the ASCII code of that character (returned by Asc).
- All the constants found in the KeyConst.WL file start with the letters VK_. These constants are displayed by the code completion in the code editor from the moment the file has been integrated with the EXTERN keyword.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|