Closed sru closed 9 years ago
That's true. Because TB_INPUT_MOUSE is invalid input mode. It's a bit flag that should only be used in conjuction with TB_INPUT_ESC or TB_INPUT_ALT. I should enforce that I guess.
Would it increase complexity to just add TB_INPUT_MOUSE
mode if it's the only mode passed?
But what would it mean? No keyboard input? :) Initially there were two modes: ESC and ALT. And MOUSE is an additional mode which works with either of those.
Hmm... I see. It was just a passing thought. Then does it make sense to lump MOUSE mode with the two keyboard modes (ESC and ALT)?
On the other thought, how are you going to enforce it?
I can make one of the modes a default one. Perhaps the one which is enabled by default. That is ESC mode. :)
+1. You might want to make sure that if mouse mode is passed alone, the keyboard mode changes to ESC mode.
What's the point of TB_INPUT_CURRENT
then if you have to pass TB_INPUT_ESC
or TB_INPUT_ALT
anyway?
@panicbit https://github.com/nsf/termbox/blob/master/src/termbox.h#L237 It returns the current input mode.
@nsf Can you think of any reason why I'm not getting the assertion using this C snippet (but do get the assertion when using the Rust wrapper of termbox)?
edit: Alright, I apparently didn't get the assertion because I was linking termbox as shared lib.
It triggers this assertion.
The program is:
See also: gchp/rustbox#32