C# Class ThoNohT.NohBoard.Keyboard.ElementDefinitions.KeyboardKeyDefinition

Inheritance: KeyDefinition
Exibir arquivo Open project: ThoNohT/NohBoard Class Usage Examples

Private Properties

Property Type Description
GetText string
UnionWith KeyboardKeyDefinition

Public Methods

Method Description
BordersWith ( KeyboardKeyDefinition otherKey ) : bool

Checks whether this key overlaps with another specified key definition.

KeyboardKeyDefinition ( int id, List boundaries, List keyCodes, string normalText, string shiftText, bool changeOnCaps ) : System

Initializes a new instance of the KeyboardKeyDefinition class.

The position of the text is determined from the bounding box of the key.

KeyboardKeyDefinition ( int id, List boundaries, List keyCodes, string text, string shiftText, bool changeOnCaps, TPoint textPosition ) : System

Initializes a new instance of the KeyboardKeyDefinition class.

Render ( Graphics g, bool pressed, bool shift, bool capsLock ) : void

Renders the key in the specified surface.

Translate ( int dx, int dy ) : ElementDefinition

Translates the element, moving it the specified distance.

UnionWith ( List keys ) : KeyDefinition

Updates the key definition to occupy a region of itself plus the specified other keys.

Private Methods

Method Description
GetText ( bool shift, bool capsLock ) : string

Determines whether to use the shift text or the regular text for this key depening on the shift, caps lock state and the key's properties. Returns the text that should be displayed for this state.

UnionWith ( IList keys ) : KeyboardKeyDefinition

Updates the key definition to occupy a region of itself plus the specified other keys.

Method Details

BordersWith() public method

Checks whether this key overlaps with another specified key definition.
public BordersWith ( KeyboardKeyDefinition otherKey ) : bool
otherKey KeyboardKeyDefinition The other key to check for overlapping on.
return bool

KeyboardKeyDefinition() public method

Initializes a new instance of the KeyboardKeyDefinition class.
The position of the text is determined from the bounding box of the key.
public KeyboardKeyDefinition ( int id, List boundaries, List keyCodes, string normalText, string shiftText, bool changeOnCaps ) : System
id int The identifier of the key.
boundaries List The boundaries.
keyCodes List The keycodes.
normalText string The normal text.
shiftText string The shift text.
changeOnCaps bool Whether to change to shift text on caps lock.
return System

KeyboardKeyDefinition() public method

Initializes a new instance of the KeyboardKeyDefinition class.
public KeyboardKeyDefinition ( int id, List boundaries, List keyCodes, string text, string shiftText, bool changeOnCaps, TPoint textPosition ) : System
id int The identifier of the key.
boundaries List The boundaries.
keyCodes List The keycodes.
text string The normal text.
shiftText string The shift text.
changeOnCaps bool Whether to change to shift text on caps lock.
textPosition TPoint The position of the text.
return System

Render() public method

Renders the key in the specified surface.
public Render ( Graphics g, bool pressed, bool shift, bool capsLock ) : void
g System.Drawing.Graphics The GDI+ surface to render on.
pressed bool A value indicating whether to render the key in its pressed state or not.
shift bool A value indicating whether shift is pressed during the render.
capsLock bool A value indicating whether caps lock is pressed during the render.
return void

Translate() public method

Translates the element, moving it the specified distance.
public Translate ( int dx, int dy ) : ElementDefinition
dx int The distance along the x-axis.
dy int The distance along the y-axis.
return ElementDefinition

UnionWith() public method

Updates the key definition to occupy a region of itself plus the specified other keys.
public UnionWith ( List keys ) : KeyDefinition
keys List The keys to union with.
return KeyDefinition