nsf / termbox-go

Pure Go termbox implementation
http://godoc.org/github.com/nsf/termbox-go
MIT License
4.66k stars 372 forks source link

Shift tab #149

Closed mattn closed 7 years ago

mattn commented 7 years ago

Shift-Tab on Linux return \x1b[[Z but termbox on windows doesn't send escape sequence to the apps. So this is workaround for handle Shift-Tab. Application can check shift-tab like below.

if runtime.GOOS == "windows" && e.Key == 527 {
    // Shift-Tab on Windows
}

When we need to add bit mask for CTRL, it should be 0x400, Alt should be 0x800.

mattn commented 7 years ago

One another way, when received Shift-TAB on windows, send two sequence. ModAlt + '[' and Z.

nsf commented 7 years ago

Key(r.virtual_scan_code | 0x200)

What key is that? if there is no such key constant, I can't just send it.

Yes, there is no such constant and terminal sends garbage only because termbox in general doesn't block any input. I would implement raw input API on windows rather than adding that. Sorry, won't add it.

mattn commented 7 years ago

I don't mind this. I just let you known this problem.