Skip to content

Commit

Permalink
feat: support function keys with alt modifiers in urxvt
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Mar 21, 2022
1 parent f9a934a commit a54f33b
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,20 @@ var sequences = map[string]Key{
"\x1b[18;2~": {Type: KeyF19},
"\x1b[19;2~": {Type: KeyF20},

// Function keys with the alt modifier, X11
"\x1b[1;3P": {Type: KeyF1, Alt: true},
"\x1b[1;3Q": {Type: KeyF2, Alt: true},
"\x1b[1;3R": {Type: KeyF3, Alt: true},
"\x1b[1;3S": {Type: KeyF4, Alt: true},
"\x1b[15;3~": {Type: KeyF5, Alt: true},
"\x1b[17;3~": {Type: KeyF6, Alt: true},
"\x1b[18;3~": {Type: KeyF7, Alt: true},
"\x1b[19;3~": {Type: KeyF8, Alt: true},
"\x1b[20;3~": {Type: KeyF9, Alt: true},
"\x1b[21;3~": {Type: KeyF10, Alt: true},
"\x1b[23;3~": {Type: KeyF11, Alt: true},
"\x1b[24;3~": {Type: KeyF12, Alt: true},

// Function keys, urxvt
"\x1b[11~": {Type: KeyF1},
"\x1b[12~": {Type: KeyF2},
Expand All @@ -335,19 +349,19 @@ var sequences = map[string]Key{
"\x1b[33~": {Type: KeyF19},
"\x1b[34~": {Type: KeyF20},

// Function keys with the alt modifier, X11
"\x1b[1;3P": {Type: KeyF1, Alt: true},
"\x1b[1;3Q": {Type: KeyF2, Alt: true},
"\x1b[1;3R": {Type: KeyF3, Alt: true},
"\x1b[1;3S": {Type: KeyF4, Alt: true},
"\x1b[15;3~": {Type: KeyF5, Alt: true},
"\x1b[17;3~": {Type: KeyF6, Alt: true},
"\x1b[18;3~": {Type: KeyF7, Alt: true},
"\x1b[19;3~": {Type: KeyF8, Alt: true},
"\x1b[20;3~": {Type: KeyF9, Alt: true},
"\x1b[21;3~": {Type: KeyF10, Alt: true},
"\x1b[23;3~": {Type: KeyF11, Alt: true},
"\x1b[24;3~": {Type: KeyF12, Alt: true},
// Function keys with the alt modifier, urxvt
"\x1b\x1b[11~": {Type: KeyF1, Alt: true},
"\x1b\x1b[12~": {Type: KeyF2, Alt: true},
"\x1b\x1b[13~": {Type: KeyF3, Alt: true},
"\x1b\x1b[14~": {Type: KeyF4, Alt: true},
"\x1b\x1b[25~": {Type: KeyF13, Alt: true},
"\x1b\x1b[26~": {Type: KeyF14, Alt: true},
"\x1b\x1b[28~": {Type: KeyF15, Alt: true},
"\x1b\x1b[29~": {Type: KeyF16, Alt: true},
"\x1b\x1b[31~": {Type: KeyF17, Alt: true},
"\x1b\x1b[32~": {Type: KeyF18, Alt: true},
"\x1b\x1b[33~": {Type: KeyF19, Alt: true},
"\x1b\x1b[34~": {Type: KeyF20, Alt: true},
}

// Hex code mappings.
Expand Down

0 comments on commit a54f33b

Please sign in to comment.