Alt+letter sends Escape code (#179) (#226)

This commit is contained in:
rrrooommmaaa 2019-02-20 17:12:57 +03:00 committed by GitHub
parent 1909c4c032
commit 8c4c842ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,14 @@ func (gui *GUI) key(w *glfw.Window, key glfw.Key, scancode int, action glfw.Acti
return return
} }
} }
// pass through alt codes
if modsPressed(mods, glfw.ModAlt) {
if r >= 97 && r < 123 || r >= 65 && r < 91 {
gui.terminal.Write([]byte{0x1b, byte(r)})
return
}
}
} }
modStr := getModStr(mods) modStr := getModStr(mods)