fix home button

This commit is contained in:
Liam Galvin 2018-12-03 12:14:03 +00:00
parent 294e206ff5
commit 5df038d223
1 changed files with 7 additions and 3 deletions

View File

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