1

I am trying to write a Linux kernel module to work similar to a 'MouseKeys' application - to grab certain keys and then output mouse events. I'm currently struggling trying to grab input in such a way that I can discard or passthrough keys based on some internal state of my module - what I want is something like:

int keyboard_callback(event) {
    if (active) {
        processKey(event);      // this would output mouse events
        return BLOCK_KEY_EVENT; // input is not visible to any applications
    }
    // input would be processed downstream as normal
    return PASSTHROUGH_KEY_EVENT;
}
....
register_input_handler(keyboard_callback);
Brian TF
  • 11
  • 2
  • 1
    Related to this: http://stackoverflow.com/questions/33836541/linux-kernel-how-to-capture-a-key-press-and-replace-it-with-another-key – Sam Protsenko Feb 16 '17 at 13:37

0 Answers0