title: writing basic keyboard interrupt handler, throws "Unknown key released"
body: <p>I have written a rudimentary keyboard interrupt handler. It uses shared interrupts and is used to print to /var/log/messages which key got pressed. But i get the following error when i try to use arrow keys and rest of the keys work fine.</p>
  
  <p><strong>Aug 19 18:59:06 vim kernel: [  112.485102] atkbd serio0: Unknown key released (translated set 2, code 0xe0 on isa0060/serio0).
  Aug 19 18:59:06 vim kernel: [  112.485108] atkbd serio0: Use 'setkeycodes e060 ' to make it known.</strong></p>
  
  <p>Pasting the code.</p>
  
  <pre><code>#include &lt;linux/kernel.h&gt;
  #include &lt;linux/module.h&gt;
  #include &lt;linux/interrupt.h&gt;
  #include &lt;asm/io.h&gt;
  
  /* This function services keyboard interrupts */
  irq_handler_t irq_handler (int irq, void *dev_id, struct pt_regs *regs) {
    static unsigned char scancode;
  
    /*
      Read keyboard status
    */
    scancode = inb (0x60);
  
    if ((scancode == 0x01) || (scancode == 0x81))
      {
        printk ("You pressed Esc !\n");
      }
    }
  
    return (irq_handler_t) IRQ_HANDLED;
  }
  
  /* Initialize the module and Register the IRQ handler */
  static int __init keybrd_int_register(void)
  {
    int result;
    /* Request IRQ 1, the keyboard IRQ */    
    result = request_irq (1, (irq_handler_t) irq_handler, IRQF_SHARED, "keyboard_stats_irq", (void *)(irq_handler));
  
    if (result)
      printk(KERN_INFO "can't get shared interrupt for keyboard\n");
  
    return result;
  }
  
  /* Remove the interrupt handler */
  static void __exit keybrd_int_unregister(void) {
    free_irq(1, (void *)(irq_handler)); /* i can't pass NULL, this is a shared interrupt handler! */
  }
  
  MODULE_LICENSE ("GPL");
  module_init(keybrd_int_register);
  module_exit(keybrd_int_unregister);
  </code></pre>
  
  <p>Can anyone please give me some clue on why this arrow keys stop working when i insert my module and start working whey i remove them?</p>
  
  <p>I am running my code on a Virtual Machine.</p>