Class Typing::Key
In: lib/typing.rb
Parent: Object
Typer Key Typing dot/f_10.png

The Key class represents a key that can be typed with xte, and stores some extra settings, such an offset, a possible associated command, etc.



UP = false
DOWN = true


command  [RW] 
name  [RW] 
state  [RW] 
tokens  [RW] 
type  [RW] 
x_offset  [RW] 
y_offset  [RW] 

Public Class methods

New Key. Options include:

Key name::name - name of the key, as understood by xte
Command::command - key command, if any, as a Proc object
Offset::offset - the offset of the key once typed, size-2 array: [x, y]. Default is [0, 0]
State::state - Does this key have state? One of nil (default), Key::UP, or Key::DOWN.
Type::type - The type of key: one of Key::NORMAL (default) or Key::DIRECTION.
Tokens::tokens - The array of tokens to interpret in string to type. Empty array [] by default.

Public Instance methods

Does this Key have a commands associated with it?

Is this a direction Key?

Is this Key pressed down?

Is this Key a special Key? Does it have a command associated with it?

Does this Key have state?

Return name of the key: a string.

Toggle the state of the Key.

Generate a string suitable for passing to xte for a this Key.