Is it possible to detect a key combination such as Ctrl+; ?
Is it possible to detect a key combination such as Ctrl+; ?
Isn't the point of ncurses to provide functionality independent of the terminal, not just VT100? Shouln't it have some universal way of telling whether the key had a Ctrl or Alt modifier?
The answer to the first question is no, since ncurses runs in the terminal, which is a VT100 emulator. This is why I said this is a hardware issue. Eg, if your display is only capable of 8 colors, neither ncurses nor anything else will give you 16, there is no point in looking fro such a possibility.
As for the second question, I am a little confused, since the previous keycode experiments do demonstrate a difference -- for example, any combo involving the alt/meta key begins with the ESC character, ascii 27. That is not the case with ctrl.
Ctrl appears to just modify the value of the primary character*, eg, b is 98, alt b is 27-98, ctrl-b is 2, alt-ctrl-b is 27-2.
* because of that, I would go with alt combinations not ctrl, since these could create conflicts -- eg, the ctrl-j problem; I also notice ctrl-i is the same as tab (surprise surprise).
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
I kinda figured out a good layout that goes around those keys, I will see how that goes.