PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

X
Y
  • Managing all the keyboard keys
  • Keys on Mobile devices (Pockets PC) and Smartphones
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
..ShortcutKey is used to find out and modify 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 = trControl + trShift + Asc("U") // Ctrl + Shift + U
BTN_BUTTON1..ShortcutKey = trControl + VK_F1       // Ctrl + F1
Syntax

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

<Result> = <Control name>..ShortcutKey
<Result>: Integer
Shortcut key associated with the control.
<Control name>: Character string (with or without quotes)
Name of control to use.

Modifying the keyboard shortcut associated with a control Hide the details

<Control name>..ShortcutKey = <New shortcut>
<Control name>: Character string (with or without quotes)
Name of control to use.
<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\Extern" directory of WINDEV or WINDEV Mobile. See remarks for more details.
  • Character keys: All you have to do is use the ASCII code of the character (returned by Asc).
Remarks

Managing all the keyboard keys

Managing all the keyboard keys with ..ShortcutKey:
  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, the EXTERN keyword must be used as follows:
    EXTERN "KEYCONST.wl"
  2. Use the constants in ..ShortcutKey:
    cControl is Control <- ControlCreate("BTN_Button", typButton, 6, 60, 160, 30, False)
    cControl..ShortcutKey = skAlt + skShift + VK_F10
Notes:
  • To manage the character keys, use the ASCII code of character (returned by Asc).
  • All the constants found in the KeyConst.WL file start with the letters VK_. As soon as the file was included with the EXTERN keyword, these constants are proposed by the automatic completion in the code editor.
Windows Mobile

Keys on Mobile devices (Pockets PC) and Smartphones

The diagrams below present the WLanguage constants associated with the keys.
Minimum required version
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment