nsf / termbox-go

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

KeyEnter and KeyCtrlM map to the same Hex value #244

Open alfred-stokespace opened 1 year ago

alfred-stokespace commented 1 year ago

See code here... https://github.com/nsf/termbox-go/blob/e788edde8c11a0755b83a1fba8e7e578cfe484ef/api_common.go#L96

    KeyEnter          Key = 0x0D
    KeyCtrlM          Key = 0x0D

I found this out the hard way while I attempted to bind KeyCtrlM for something and found out by accident that when I hit the Enter key I got the same behavior.... a feature; not a bug perhaps?

nsf commented 1 year ago

It's not a bug, terminal sends 0x0D byte on Enter or Ctrl+M.