CAST II Game Engine |
||||||||
![]() |
MAIN | FEATURES | SCREENSHOTS | FORUMS | MANUAL | DOWNLOADS | CONTACTS | |
type TController = class(TSubsystem)
TController polls input, checks if it matches specified in bindings event sequences and performs bond actions. Also some input-related routines and properties are provided.
| Name | Description | |
|---|---|---|
![]() | CaptureMouseX | Mouse X before mouse was captured |
![]() | CaptureMouseY | Mouse Y before mouse was captured |
![]() | DblClickTimeout | Double click timeout. Used by events with btKeyDblClick event type. |
![]() | EnableCharactersInput | If True all entered aplhabetical characters will be stored in InputBuffer |
![]() | FInputBuffer | Current user input buffer |
![]() | FMouseCapture | Mouse capture state |
![]() | Handle | Application window handle |
![]() | KeyboardState | Current keyboard state |
![]() | KeyQueryState | Current key query state |
![]() | KeyStr | String names of keys |
![]() | LastKeyState | Last keyboard state |
![]() | LastMouseState | Last mouse state |
![]() | MessageHandler | A message handler to direct events to |
![]() | MouseQueryTimeOut | Minimum time in ms between queries for mouse strokes |
![]() | MouseState | Current mouse state |
![]() | MouseWindow | A rectangle where the mouse cursor can be |
![]() | MouseX | Current mouse X |
![]() | MouseY | Current mouse Y |
![]() | constructor Create(AHandle: Cardinal; AMessageHandler: BaseMsg.TMessageHandler); virtual; |
![]() | destructor Destroy; override; |
![]() | procedure ApplyMouseCapture(Value: Boolean); virtual; |
![]() | procedure BindCommand(const ABinding: TBindingStr; MsgType: CMessage; const ATimeoutMs: LongWord = DefaultTimeout); virtual; |
![]() | procedure BindDelegate(const ABinding: TBindingStr; Delegate: TInputDelegate; ACustomData: SmallInt; const ATimeoutMs: LongWord = 0); virtual; |
![]() | procedure BindPointer(const ABinding: TBindingStr; const ActionType: Longword; const Data: Pointer; const Value: Word = 0; const ATimeoutMs: LongWord = 0); virtual; |
![]() | function GetHotKey(Key: Word; Modifiers: TKeyModifiers): THotkey; |
![]() | function GetHotkeyModifiers(HotKey: THotkey): TKeyModifiers; |
![]() | function GetInputBuffer: string; |
![]() | procedure GetInputState; virtual; abstract; |
![]() | function GetMouseEvent: TEventType; |
![]() | procedure HandleMessage(const Msg: TMessage); override; |
![]() | function HotKeyToStr(HotKey: THotkey): string; |
![]() | procedure InputEventsToMessages; |
![]() | function IsModifierKey(Key: Word): Boolean; |
![]() | function KeyToStr(Key: Integer): string; |
![]() | procedure ProcessInput(const EventFilter: TInputFilter); |
![]() | function QueryInput: TInputQueryResult; virtual; |
![]() | procedure SetCursorCapturePos; |
![]() | procedure SetMouseCapture(const Value: Boolean); virtual; |
![]() | procedure SetMouseWindow(const X1, Y1, X2, Y2: Longint); virtual; |
![]() | function StrToHotKey(const BindStr: TBindingStr): THotkey; |
![]() | function StrToKey(Name: string): Integer; |
![]() | procedure UnBindAll; |
![]() | constructor Create(AHandle: Cardinal; AMessageHandler: BaseMsg.TMessageHandler); virtual; |
![]() | destructor Destroy; override; |
![]() | procedure ApplyMouseCapture(Value: Boolean); virtual; |
Implementation-specific mouse capture routine
![]() | procedure BindCommand(const ABinding: TBindingStr; MsgType: CMessage; const ATimeoutMs: LongWord = DefaultTimeout); virtual; |
Parses the specified binding string and binds the specified message class to it. ATimeoutMs specifies the maximum time between two consequent events.
![]() | procedure BindDelegate(const ABinding: TBindingStr; Delegate: TInputDelegate; ACustomData: SmallInt; const ATimeoutMs: LongWord = 0); virtual; |
Parses the specified binding string and binds the specified delegate call to it. ATimeoutMs specifies the maximum time between two consequent events.
![]() | procedure BindPointer(const ABinding: TBindingStr; const ActionType: Longword; const Data: Pointer; const Value: Word = 0; const ATimeoutMs: LongWord = 0); virtual; |
Parses the specified binding string and binds the specified pointer action to it. ATimeoutMs specifies the maximum time between two consequent events.
ActionType can be one of the following:
atBooleanOn, atBooleanOff, atBooleanToggle, atSetByte, atSetWord, atSetLongWord It's recommended to use BindCommand or BindDelegate instead.
![]() | function GetHotKey(Key: Word; Modifiers: TKeyModifiers): THotkey; |
Returns a hot key by key and set of modifiers
![]() | function GetHotkeyModifiers(HotKey: THotkey): TKeyModifiers; |
Returns a set of modifiers from a hotkey
![]() | function GetInputBuffer: string; |
Returns user input buffer and clear it
![]() | procedure GetInputState; virtual; abstract; |
Implementation-specific input poll
![]() | function GetMouseEvent: TEventType; |
Returns mouse event which occured since last process
![]() | procedure HandleMessage(const Msg: TMessage); override; |
Default message handler
![]() | function HotKeyToStr(HotKey: THotkey): string; |
Returns a string representation of the specified hot key
![]() | procedure InputEventsToMessages; |
Transforms all input events to corresponding messages and directs them to MessageHandler
![]() | function IsModifierKey(Key: Word): Boolean; |
Returns True if Key is a one of modifiers key (CTRL, ALT, etc)
![]() | function KeyToStr(Key: Integer): string; |
Returns a string name of the specified key
![]() | procedure ProcessInput(const EventFilter: TInputFilter); |
Pools input and checks if any of bindings should be activated
![]() | function QueryInput: TInputQueryResult; virtual; |
Performs input query. Returns set of input query elements and fills internal events array.
![]() | procedure SetCursorCapturePos; |
Places mouse cursor to capture position (center of current window)
![]() | procedure SetMouseCapture(const Value: Boolean); virtual; |
If set to True captures mouse and hide its cursor
![]() | procedure SetMouseWindow(const X1, Y1, X2, Y2: Longint); virtual; |
Sets mouse window
![]() | function StrToHotKey(const BindStr: TBindingStr): THotkey; |
Parses a binding string and returns hot key
![]() | function StrToKey(Name: string): Integer; |
Returns a key which corresponds to the specified name
![]() | procedure UnBindAll; |
Clears all bindings
![]() | property InputBuffer: string; |
![]() | property MouseCapture: Boolean; |
![]() | property SystemCursor: Boolean; |
![]() | property InputBuffer: string; |
Current user input buffer. Reading this property will clear the buffer.
![]() | property MouseCapture: Boolean; |
If set to True captures mouse and hide its cursor
![]() | property SystemCursor: Boolean; |
Read/write this property to determine if system mouse cursor is used.
|
Last modified: Jan 6, 2010 |