ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Managing all the keyboard keys
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The ShortcutKey property gets and sets the keyboard shortcut associated with a control.
Example
// To be included in the declaration code of global variables of window
EXTERN "KEYCONST.wl"

BTN_BUTTON1.ShortcutKey = skControl + skShift + Asc("U") // Ctrl + Shift + U
BTN_BUTTON1.ShortcutKey = skControl + VK_F1 // Ctrl + F1
Syntax

Finding out the keyboard shortcut associated with a control Hide the details

<Result> = <Control used>.ShortcutKey
<Result>: Integer
Shortcut key associated with the control.
<Control used>: Control name
Name of the control to be used.

Modifying the keyboard shortcut associated with a control Hide the details

<Control used>.ShortcutKey = <New shortcut>
<Control used>: Control name
Name of the control to be used.
<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:
    skAltAlt key.
    skControlCtrl key.
    skShiftShift key.
  • Specific control keys: Additional constants are available in the "KeyConst.wl" file. 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 ASCII code of the character (returned by Asc).
Remarks

Managing all the keyboard keys

To manage all the keys with the ShortcutKey property:
  1. 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:
    EXTERN "KEYCONST.wl"
  2. 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.
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/07/2023

Send a report | Local help