The flushinp routine throws away any typeahead that has been typed by
the user and has not yet been read by the program.
though that applies to what's in the FIFO (still a race with the actual
I tested flushinp and it doesn't help
But I think I understand the problem. I didn't know that returned codes are related to terminal settings in this case, and because I use my own poll, the event on keyboard is created before I call get_wch function, and then ncurses cannot send smkx in time.
Thank you for reply - I hope so I have a better idea how it works