mirror of https://github.com/liamg/aminal.git
few more ansi sequences done
This commit is contained in:
parent
49e502cc0b
commit
7d0aebbfc2
|
@ -64,6 +64,8 @@ func (gui *GUI) key(w *glfw.Window, key glfw.Key, scancode int, action glfw.Acti
|
|||
gui.capslock = !gui.capslock
|
||||
case glfw.KeyEnter:
|
||||
gui.terminal.Write([]byte{0x0a})
|
||||
case glfw.KeyBackspace:
|
||||
gui.terminal.Write([]byte{0x08})
|
||||
default:
|
||||
if key >= 0x41 && key <= 0x5a { // A-Z, normalise to lower
|
||||
key += 0x20
|
||||
|
|
|
@ -259,6 +259,11 @@ func (terminal *Terminal) Read() error {
|
|||
terminal.newLine()
|
||||
case 0x0d:
|
||||
terminal.position.Col = 0
|
||||
case 0x08:
|
||||
// backspace
|
||||
terminal.position.Col--
|
||||
case 0x07:
|
||||
// @todo ring bell
|
||||
default:
|
||||
// render character at current location
|
||||
// fmt.Printf("%s\n", string([]byte{b}))
|
||||
|
|
Loading…
Reference in New Issue