Keyboard driver
Posted: Fri Jun 10, 2005 5:03 am
I'm going to write a keyboard driver to my microkernel, but I have a question.
Is this the best way:
When a program wants user input from the keyboard, it tells the keyboard driver process to create a buffer for it and then when the keyboard IRQ fires, the keyboard handler handles it and pushes the scancode on the buffer and then tells the owner of that buffer that it has received data.
How and where should I translate scancodes to real symbols? In the keyboard driver, instead of pushing just the scancode, it pushes both the scancode and the translated symbol?
Or should the keyboard driver just push the scancode and then libc translates using the specified keymap, loaded into the program's user space?
Should I have different attributes for buffers? Like, tell the owner process just when key X is hit instead of any key?
How should I specify that key when the keyboard driver doesn't know about any keymaps?
How should I handle meta keys like alt and shift?
I hope for some input now
Is this the best way:
When a program wants user input from the keyboard, it tells the keyboard driver process to create a buffer for it and then when the keyboard IRQ fires, the keyboard handler handles it and pushes the scancode on the buffer and then tells the owner of that buffer that it has received data.
How and where should I translate scancodes to real symbols? In the keyboard driver, instead of pushing just the scancode, it pushes both the scancode and the translated symbol?
Or should the keyboard driver just push the scancode and then libc translates using the specified keymap, loaded into the program's user space?
Should I have different attributes for buffers? Like, tell the owner process just when key X is hit instead of any key?
How should I specify that key when the keyboard driver doesn't know about any keymaps?
How should I handle meta keys like alt and shift?
I hope for some input now