AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar para Android
  • Overview
  • Keyboard Variable
  • Manage the code of the keys
  • Example
  • Perform an action in the Key down event
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
The Keyboard variable makes it possible to retrieve the parameters of the events of a physical keyboard. Indeed, an Android device can have a physical keyboard, or can be connected to a physical keyboard (through the Samsung DeX system for example).
This variable must be used only in events related to the physical keyboard:
  • Key down (WM_KEYDOWN),
  • Key up (WM_KEYUP).
On Android, these two events are called only if they are triggered by a keyboard event coming from a physical keyboard.
On Chrome OS, these two events are not called.
Note: This variable can be used in Simulator mode..
Keyboard Variable
The Keyboard variable includes the following elements:
Keyboard.AltBoolean
Indicates whether the Alt key is pressed when the keyboard event is triggered.
Keyboard.CodeInteger
Indicates the code corresponding to the key that triggered the keyboard event.
Keyboard.CtrlBoolean
Indicates whether the Ctrl key is pressed when the keyboard event is triggered.
Keyboard.ShiftBoolean
Indicates whether the Shift key is pressed when the keyboard event is triggered.

Manage the code of the keys

To manage the code of the keys:
  1. Include the KeyConst.WL file in your project. This file associates a specific constant with each keyboard key. This file can be found in the directory WINDEV/WEBDEV/WINDEV Mobile (subdirectory "Personal\External"). To include this file in your applications, you need to use the EXTERN keyword as follows:
    EXTERN "KEYCONST.wl"
  2. Use the desired constants with the Keyboard.Code variable:
    IF Keyboard.Code = VK_Space THEN
    ...
    END
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.
Example

Perform an action in the Key down event

The following code is used to perform an action in the "Key down" event of an edit control when using Ctrl + V.
IF Keyboard.Code = VK_V _AND_ Keyboard.Ctrl THEN
Info ("Ctrl V used")
...
END
Versión mínima requerida
  • Versión 24
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 30/09/2024

Señalar un error o enviar una sugerencia | Ayuda local