Skip to content
Myr

Simplify key/sequence map

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Muehlhaeuser · committed by Christian Muehlhaeuser · parent 0957c58 · Browse files · 1 file+21 added−21 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+21 added−21 removed

  • other:+21 added−21 removed

1 file+21 added−21 removed

modified:key.go+21 added-21 removed
202 unmodified lines
203204// Mapping for hex codes to consts. Unclear why these won't register as205// sequences.206var hexes = map[string]Key{207 "1b5b5a": Key{Type: KeyShiftTab},208 "1b0d": Key{Type: KeyEnter, Alt: true},209 "1b7f": Key{Type: KeyDelete, Alt: true},210 "1b5b48": Key{Type: KeyHome},211 "1b5b377e": Key{Type: KeyHome}, // urxvt212 "1b5b313b3348": Key{Type: KeyHome, Alt: true},213 "1b1b5b377e": Key{Type: KeyHome, Alt: true}, // ursvt214 "1b5b46": Key{Type: KeyEnd},215 "1b5b387e": Key{Type: KeyEnd}, // urxvt216 "1b5b313b3346": Key{Type: KeyEnd, Alt: true},217 "1b1b5b387e": Key{Type: KeyEnd, Alt: true}, // urxvt218 "1b5b357e": Key{Type: KeyPgUp},219 "1b5b353b337e": Key{Type: KeyPgUp, Alt: true},220 "1b1b5b357e": Key{Type: KeyPgUp, Alt: true}, // urxvt221 "1b5b367e": Key{Type: KeyPgDown},222 "1b5b363b337e": Key{Type: KeyPgDown, Alt: true},223 "1b1b5b367e": Key{Type: KeyPgDown, Alt: true}, // urxvt224 "1b5b313b3341": Key{Type: KeyUp, Alt: true},225 "1b5b313b3342": Key{Type: KeyDown, Alt: true},226 "1b5b313b3343": Key{Type: KeyRight, Alt: true},227 "1b5b313b3344": Key{Type: KeyLeft, Alt: true},207 "1b5b5a": {Type: KeyShiftTab},208 "1b0d": {Type: KeyEnter, Alt: true},209 "1b7f": {Type: KeyDelete, Alt: true},210 "1b5b48": {Type: KeyHome},211 "1b5b377e": {Type: KeyHome}, // urxvt212 "1b5b313b3348": {Type: KeyHome, Alt: true},213 "1b1b5b377e": {Type: KeyHome, Alt: true}, // ursvt214 "1b5b46": {Type: KeyEnd},215 "1b5b387e": {Type: KeyEnd}, // urxvt216 "1b5b313b3346": {Type: KeyEnd, Alt: true},217 "1b1b5b387e": {Type: KeyEnd, Alt: true}, // urxvt218 "1b5b357e": {Type: KeyPgUp},219 "1b5b353b337e": {Type: KeyPgUp, Alt: true},220 "1b1b5b357e": {Type: KeyPgUp, Alt: true}, // urxvt221 "1b5b367e": {Type: KeyPgDown},222 "1b5b363b337e": {Type: KeyPgDown, Alt: true},223 "1b1b5b367e": {Type: KeyPgDown, Alt: true}, // urxvt224 "1b5b313b3341": {Type: KeyUp, Alt: true},225 "1b5b313b3342": {Type: KeyDown, Alt: true},226 "1b5b313b3343": {Type: KeyRight, Alt: true},227 "1b5b313b3344": {Type: KeyLeft, Alt: true},228}229230// ReadKey reads keypress input from a TTY and returns a string representation231// of a key.
47 unmodified lines