Method: TTY2::Reader::Keys.ctrl_keys

Defined in:
lib/tty2/reader/keys.rb

.ctrl_keysObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/tty2/reader/keys.rb', line 7

def ctrl_keys
  {
    ?\C-a => :ctrl_a,
    ?\C-b => :ctrl_b,
    ?\C-c => :ctrl_c,
    ?\C-d => :ctrl_d,
    ?\C-e => :ctrl_e,
    ?\C-f => :ctrl_f,
    ?\C-g => :ctrl_g,
    ?\C-h => :ctrl_h, # identical to "\b"
    ?\C-i => :ctrl_i, # identical to "\t"
    ?\C-j => :ctrl_j, # identical to "\n"
    ?\C-k => :ctrl_k,
    ?\C-l => :ctrl_l,
    ?\C-m => :ctrl_m, # identical to "\r"
    ?\C-n => :ctrl_n,
    ?\C-o => :ctrl_o,
    ?\C-p => :ctrl_p,
    ?\C-q => :ctrl_q,
    ?\C-r => :ctrl_r,
    ?\C-s => :ctrl_s,
    ?\C-t => :ctrl_t,
    ?\C-u => :ctrl_u,
    ?\C-v => :ctrl_v,
    ?\C-w => :ctrl_w,
    ?\C-x => :ctrl_x,
    ?\C-y => :ctrl_y,
    ?\C-z => :ctrl_z,
    ?\C-@ => :ctrl_space,
    ?\C-| => :ctrl_backslash, # both Ctrl-| & Ctrl-     ?\C-] => :ctrl_square_close,
    "\e[1;5A" => :ctrl_up,
    "\e[1;5B" => :ctrl_down,
    "\e[1;5C" => :ctrl_right,
    "\e[1;5D" => :ctrl_left
  }
end