Merge pull request #106 from liamg/fix-home-button

fix home button
This commit is contained in:
Liam Galvin 2018-12-03 12:39:06 +00:00 committed by GitHub
commit 0ab63e3946
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -167,11 +167,15 @@ func (gui *GUI) key(w *glfw.Window, key glfw.Key, scancode int, action glfw.Acti
'3', '~', '3', '~',
}) })
case glfw.KeyHome: case glfw.KeyHome:
if gui.terminal.IsApplicationCursorKeysModeEnabled() {
if modStr == "" { if modStr == "" {
gui.terminal.Write([]byte("\x1b[1~")) gui.terminal.Write([]byte("\x1b[1~"))
} else { } else {
gui.terminal.Write([]byte(fmt.Sprintf("\x1b[1;%s~", modStr))) gui.terminal.Write([]byte(fmt.Sprintf("\x1b[1;%s~", modStr)))
} }
} else {
gui.terminal.Write([]byte("\x1b[H"))
}
case glfw.KeyEnd: case glfw.KeyEnd:
if modStr == "" { if modStr == "" {
gui.terminal.Write([]byte("\x1b[4~")) gui.terminal.Write([]byte("\x1b[4~"))