Capturing key events in the linux console
===

I have a problem, that is similar to a lot of other's before me, but different in a way that makes it much more difficult. :) 

I'm writing a text editor for the Linux console. There is no X11 running, so forget about any toolkit for that. I want to capture key down and key-up events as I want to be able to mark sections of text by holding down shift and using the arrow keys (much like you would in an X-based or Windows-based editor).

I've previously managed to write an application that uses raw mode to access key scancodes, but it is unable to handle detecting shift key and arrow keys at the same time.

Does anyone have an example code that is able to detect any key combinations (or at least all combinations with shift, ctrl and alt).
