diff --git a/gui/gui.go b/gui/gui.go index 52cdff4..eb18b3a 100644 --- a/gui/gui.go +++ b/gui/gui.go @@ -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 diff --git a/raft b/raft index 93bd95d..9281a9e 100755 Binary files a/raft and b/raft differ diff --git a/terminal/terminal.go b/terminal/terminal.go index e2f6c8b..9e85b05 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -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}))