I have a interrupt handler written in ASM. It's more like a boilerplate really, it just calls the C interrupt handler. My initial approach was using a 1-character buffer (just for testing purposes) in addition to a buffer that hold a byte that is either 0 (not down) or 1 (down) for each key (but this last buffer is not really relevant to the rest of the story). I read some things on the scancodes and decided I would just go with trial-and-error conversion of the scancodes to ascii-codes, an approach that worked reasonably well (with the obvious downside that I don't really understand what's going on) when I just want to print characters on the screen. When I want to adjust the position of the cursor using the arrow keys, for example, it gets more complicated as the arrow keys cannot be passed as ascii-codes. I could just pass scancodes but then I would need to check for all special keys in the library (or wherever I want to do this) and this just feels wrong. A unified approach, where both the scancode and the ascii-code, if applicable, seems most beneficial to me.
However, I just checked and some special keys (especially the block printscreen, pause/break, insert, home, ...) have multiple-byte scancodes or other weird behaviour (printscreen seems to fire only when released, pause/break only when pressed). Also, handling and checking the various scancode sets concerns me, as I have no idea how to do that... The handling of keypresses seems like a fairly standard problem in OS development and I'm a little ashamed that I can't find a good solution on my own. I was hoping that there is a standard approach to do this. In any case I'd be open to suggestions or commentary. For the record: I read the wiki and googled, but it's possible I missed some things (and to be honest, I don't understand too much of the wiki, though I checked and Bochs seems to use scancode set 1).
Anyway, I have good experiences with this forum, so I'm hoping for some intelligent replies again
