C# Class Flood.GUI.Input.InputHandler

Input handling.
Mostrar archivo Open project: FloodProject/flood

Public Properties

Property Type Description
HoveredControl Flood.GUI.Controls.Control
KeyboardFocus Flood.GUI.Controls.Control
MouseFocus Flood.GUI.Controls.Control
MousePosition Vector2i

Public Methods

Method Description
DoSpecialKeys ( Control canvas, char chr ) : bool

Handles copy, paste etc.

HandleAccelerator ( Control canvas, char chr ) : bool

Handles accelerator input.

IsKeyDown ( Keys key ) : bool

Checks if the given key is pressed.

OnCanvasThink ( Control control ) : void

Handles focus updating and key autorepeats.

OnKeyEvent ( Control canvas, Keys key, bool down ) : bool

Key handler.

OnMouseClicked ( Control canvas, int mouseButton, bool down ) : bool

Mouse click handler.

OnMouseMoved ( Control canvas, int x, int y, int dx, int dy ) : void

Mouse moved handler.

Private Methods

Method Description
FindKeyboardFocus ( Control control ) : void
UpdateHoveredControl ( Control inCanvas ) : void

Method Details

DoSpecialKeys() public static method

Handles copy, paste etc.
public static DoSpecialKeys ( Control canvas, char chr ) : bool
canvas Flood.GUI.Controls.Control Canvas.
chr char Input character.
return bool

HandleAccelerator() public static method

Handles accelerator input.
public static HandleAccelerator ( Control canvas, char chr ) : bool
canvas Flood.GUI.Controls.Control Canvas.
chr char Input character.
return bool

IsKeyDown() public static method

Checks if the given key is pressed.
public static IsKeyDown ( Keys key ) : bool
key Keys Key to check.
return bool

OnCanvasThink() public static method

Handles focus updating and key autorepeats.
public static OnCanvasThink ( Control control ) : void
control Flood.GUI.Controls.Control Unused.
return void

OnKeyEvent() public static method

Key handler.
public static OnKeyEvent ( Control canvas, Keys key, bool down ) : bool
canvas Flood.GUI.Controls.Control Canvas.
key Keys Key.
down bool True if the key is down.
return bool

OnMouseClicked() public static method

Mouse click handler.
public static OnMouseClicked ( Control canvas, int mouseButton, bool down ) : bool
canvas Flood.GUI.Controls.Control Canvas.
mouseButton int Mouse button number.
down bool Specifies if the button is down.
return bool

OnMouseMoved() public static method

Mouse moved handler.
public static OnMouseMoved ( Control canvas, int x, int y, int dx, int dy ) : void
canvas Flood.GUI.Controls.Control Canvas.
x int
y int
dx int
dy int
return void

Property Details

HoveredControl public_oe static_oe property

Control currently hovered by mouse.
public static Control,Flood.GUI.Controls HoveredControl
return Flood.GUI.Controls.Control

KeyboardFocus public_oe static_oe property

Control that corrently has keyboard focus.
public static Control,Flood.GUI.Controls KeyboardFocus
return Flood.GUI.Controls.Control

MouseFocus public_oe static_oe property

Control that currently has mouse focus.
public static Control,Flood.GUI.Controls MouseFocus
return Flood.GUI.Controls.Control

MousePosition public_oe static_oe property

Current mouse position.
public static Vector2i MousePosition
return Vector2i