Class: Tea::Kbd::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/tea/m_event_keyboard.rb

Overview

Superclass for all Kbd events.

Direct Known Subclasses

Down, Up

Constant Summary collapse

@@sdl_key_table =
{
SDL::Key::BACKSPACE => :BACKSPACE,
SDL::Key::TAB => :TAB,
#SDL::Key::CLEAR => clear, # ???
SDL::Key::RETURN => :ENTER,
SDL::Key::PAUSE => :PAUSE,
SDL::Key::ESCAPE => :ESCAPE,
SDL::Key::SPACE => :SPACE,
SDL::Key::EXCLAIM => :EXCLAMATION_MARK,
SDL::Key::QUOTEDBL => :DOUBLE_QUOTE,
SDL::Key::HASH => :HASH,
SDL::Key::DOLLAR => :DOLLAR,
SDL::Key::AMPERSAND => :AMPERSAND,
SDL::Key::QUOTE => :QUOTE,
SDL::Key::LEFTPAREN => :OPEN_PAREN,
SDL::Key::RIGHTPAREN => :CLOSE_PAREN,
SDL::Key::ASTERISK => :ASTERISK,
SDL::Key::PLUS => :PLUS,
SDL::Key::COMMA => :COMMA,
SDL::Key::MINUS => :MINUS,
SDL::Key::PERIOD => :PERIOD,
SDL::Key::SLASH => :SLASH,
SDL::Key::K0 => :K0,
SDL::Key::K1 => :K1,
SDL::Key::K2 => :K2,
SDL::Key::K3 => :K3,
SDL::Key::K4 => :K4,
SDL::Key::K5 => :K5,
SDL::Key::K6 => :K6,
SDL::Key::K7 => :K7,
SDL::Key::K8 => :K8,
SDL::Key::K9 => :K9,
SDL::Key::COLON => :COLON,
SDL::Key::SEMICOLON => :SEMICOLON,
SDL::Key::LESS => :LESS_THAN,
SDL::Key::EQUALS => :EQUALS,
SDL::Key::GREATER => :GREATER_THAN,
SDL::Key::QUESTION => :QUESTION_MARK,
SDL::Key::AT => :AT,
SDL::Key::LEFTBRACKET => :OPEN_SQUARE_BRACKET,
SDL::Key::BACKSLASH => :BACKSLASH,
SDL::Key::RIGHTBRACKET => :CLOSE_SQUARE_BRACKET,
SDL::Key::CARET => :CARET,
SDL::Key::UNDERSCORE => :UNDERSCORE,
SDL::Key::BACKQUOTE => :BACKTICK,
SDL::Key::A => :A,
SDL::Key::B => :B,
SDL::Key::C => :C,
SDL::Key::D => :D,
SDL::Key::E => :E,
SDL::Key::F => :F,
SDL::Key::G => :G,
SDL::Key::H => :H,
SDL::Key::I => :I,
SDL::Key::J => :J,
SDL::Key::K => :K,
SDL::Key::L => :L,
SDL::Key::M => :M,
SDL::Key::N => :N,
SDL::Key::O => :O,
SDL::Key::P => :P,
SDL::Key::Q => :Q,
SDL::Key::R => :R,
SDL::Key::S => :S,
SDL::Key::T => :T,
SDL::Key::U => :U,
SDL::Key::V => :V,
SDL::Key::W => :W,
SDL::Key::X => :X,
SDL::Key::Y => :Y,
SDL::Key::Z => :Z,
SDL::Key::DELETE => :DELETE,
SDL::Key::KP0 => :NP0,
SDL::Key::KP1 => :NP1,
SDL::Key::KP2 => :NP2,
SDL::Key::KP3 => :NP3,
SDL::Key::KP4 => :NP4,
SDL::Key::KP5 => :NP5,
SDL::Key::KP6 => :NP6,
SDL::Key::KP7 => :NP7,
SDL::Key::KP8 => :NP8,
SDL::Key::KP9 => :NP9,
SDL::Key::KP_PERIOD => :NP_PERIOD,
SDL::Key::KP_DIVIDE => :NP_DIVIDE,
SDL::Key::KP_MULTIPLY => :NP_MULTIPLY,
SDL::Key::KP_MINUS => :NP_MINUS,
SDL::Key::KP_PLUS => :NP_PLUS,
SDL::Key::KP_ENTER => :NP_ENTER,
SDL::Key::KP_EQUALS => :NP_EQUALS,
SDL::Key::UP => :UP,
SDL::Key::DOWN => :DOWN,
SDL::Key::RIGHT => :RIGHT,
SDL::Key::LEFT => :LEFT,
SDL::Key::INSERT => :INSERT,
SDL::Key::HOME => :HOME,
SDL::Key::END => :END,
SDL::Key::PAGEUP => :PAGE_UP,
SDL::Key::PAGEDOWN => :PAGE_DOWN,
SDL::Key::F1 => :F1,
SDL::Key::F2 => :F2,
SDL::Key::F3 => :F3,
SDL::Key::F4 => :F4,
SDL::Key::F5 => :F5,
SDL::Key::F6 => :F6,
SDL::Key::F7 => :F7,
SDL::Key::F8 => :F8,
SDL::Key::F9 => :F9,
SDL::Key::F10 => :F10,
SDL::Key::F11 => :F11,
SDL::Key::F12 => :F12,
#SDL::Key::F13 => F13, # Who
#SDL::Key::F14 => F14, # has
#SDL::Key::F15 => F15, # these?
SDL::Key::NUMLOCK => :NUM_LOCK,
SDL::Key::CAPSLOCK => :CAPS_LOCK,
SDL::Key::SCROLLOCK => :SCROLL_LOCK,
SDL::Key::RSHIFT => :R_SHIFT,
SDL::Key::LSHIFT => :L_SHIFT,
SDL::Key::RCTRL => :R_CTRL,
SDL::Key::LCTRL => :L_CTRL,
SDL::Key::RALT => :R_ALT,
SDL::Key::LALT => :L_ALT,
#SDL::Key::RMETA => right meta, # 'meta' should
#SDL::Key::LMETA => left meta,  # be 'alt'?
SDL::Key::LSUPER => :L_SUPER,
SDL::Key::RSUPER => :R_SUPER,
SDL::Key::MODE => :ALT_GR,
#SDL::Key::HELP => help, # Rare enough to cause problems.
SDL::Key::PRINT => :PRINT_SCREEN,
SDL::Key::SYSREQ => :SYS_REQ,
SDL::Key::BREAK => :BREAK,
SDL::Key::MENU => :MENU,
#SDL::Key::POWER => power, # "Power Macintosh" power key
SDL::Key::EURO => :EURO, # Some European keyboards need this.
}

Class Method Summary collapse

Class Method Details

.each_keyObject

Call a block for each defined Tea key constant.



149
150
151
# File 'lib/tea/m_event_keyboard.rb', line 149

def Event.each_key
  @@sdl_key_table.each_value { |key_const| yield key_const }
end