More on key-trapping in ncurses
getch() method of ncurses window catches function keys and control keys, but not alt/meta keys which require checking 2 consecutive keys (ESC and char). Manver’s VER (keyboard.rb) does this, but I don’t think it traps Meta+Ctrl and Meta+shift+Ctrl keys.
Also, I faced some problems (with keyboard.rb), when i needed to pass control from one form to another, and have it come back. The previous assignment was obviously overwritten. I’ve modified it and made a method
getchar is a stand-in replacement for
getch (if you used lib/ver/window to create your window). It will wait upon an ESC and return meta and meta/ctrl, meta/shift/control combinations in addition to the basic Function keys.