Class TLCLKeyPressHandler
Unit
Declaration
type TLCLKeyPressHandler = class(TObject)
Description
Convert LCL OnKeyDown and OnUTF8KeyPress into a single CGE event OnPress.
In VCL and LCL KeyPress (or UTF8KeyPress in LCL) and KeyDown are separate events. While in CGE they are one event, and passed as one event to TCastleUserInterface.KeyDown, because this is more comfortable to process (as it corresponds to one user action, and allows configurable TInputShortcut to work).
Hierarchy
- TObject
- TLCLKeyPressHandler
Overview
Methods
procedure KeyDown(const Key: Word; const Shift: TShiftState); |
|
procedure UTF8KeyPress(const UTF8Key: TUTF8Char); |
|
procedure BeforeKeyUp(const Key: Word; const Shift: TShiftState); |
|
procedure Flush; |
Properties
property OnPress: TControlInputPressReleaseEvent read FOnPress write FOnPress; |
Description
Methods
procedure KeyDown(const Key: Word; const Shift: TShiftState); |
|
Call these events when corresponding Lazarus event (OnKeyDown, OnUTF8KeyPress) occurs. They may call OnPress in turn. |
procedure UTF8KeyPress(const UTF8Key: TUTF8Char); |
|
procedure BeforeKeyUp(const Key: Word; const Shift: TShiftState); |
|
Call this when Lazarus OnKeyUp event occurs. It may call OnPress in return. Receiving "key up" event from Lazarus may indicate that we have to do OnPress now. This matters for keys without corresponding String/Char representation (thus, without UTF8KeyPress call), like keyArrowLeft. If we have buffered to "send the OnPress for this key", we need to send it now, before the OnRelease for the same key is generated. Otherwise the KeyUp would cause OnRelease of the arrow key, and later Flush call would send OnPress for the same key. |
Properties
property OnPress: TControlInputPressReleaseEvent read FOnPress write FOnPress; |
|
Called when we collect enough information to make a CGE press event. |
Generated by PasDoc 0.16.0.