Class: RubyJard::Keys

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_jard/keys.rb

Overview

A helper class to store pre-defined keys and key bindings

Constant Summary collapse

END_LINE =
["\n", "\r\n", "\r"].freeze
CTRL_C =
"\u0003"
CTRL_D =
"\u0004"
F1 =
"\eOP"
F2 =
"\eOQ"
F3 =
"\eOR"
F4 =
"\eOS"
F5 =
"\e[15~"
F6 =
"\e[17~"
F7 =
"\e[18~"
F8 =
"\e[19~"
F9 =
"\e[20~"
F10 =
"\e[21~"
F11 =
"\e[23~"
F12 =
"\e[24~"
SHIFT_F1 =
"\e1;2P"
SHIFT_F2 =
"\e1;2Q"
SHIFT_F3 =
"\e1;2R"
SHIFT_F4 =
"\e1;2S"
SHIFT_F5 =
"\e[15;2~"
SHIFT_F6 =
"\e[17;2~"
SHIFT_F7 =
"\e[18;2~"
SHIFT_F8 =
"\e[19;2~"
SHIFT_F9 =
"\e[20;2~"
SHIFT_F10 =
"\e[21;2~"
SHIFT_F11 =
"\e[23;2~"
SHIFT_F12 =
"\e[24;2~"
DEFAULT_KEY_BINDINGS =
{
  F2       => (ACTION_FILTER   = :switch_filter),
  F5       => (ACTION_LIST     = :list),
  F6       => (ACTION_UP       = :up),
  SHIFT_F6 => (ACTION_DOWN     = :down),
  F7       => (ACTION_STEP     = :step),
  SHIFT_F7 => (ACTION_STEP_OUT = :step_out),
  F8       => (ACTION_NEXT     = :next),
  F9       => (ACTION_CONTINUE = :continue),
  CTRL_D   => ACTION_CONTINUE
}.freeze