Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to develop my own keyboard driver to my own keypad. I have to use GPIO to identify Key Events and use I2c to get scan code. I am going to develop the driver like this.

#include <linux/gpio.h> 
#include <linux/interrupt.h>

#define GPIO 1 //gpio PIN
if(gpio_request(GPIO, "Description")){

int irq = 0;
if((irq = gpio_to_irq(GPIO)) < 0 ){

int init_module(){
    int result = request_irq(GPIO, handler_func, IRQF_TRIGGER_LOW,"Description", "Device id");

void handler_func(...){
    //get scan code via i2c

I need to develop an interface and have to handle following operations

  In my keypad, print as "1abc" on the [KEY1] .
  1. When press key, display 1st Characters as it is -> "1"
  2. Special key combinations are used to input other 3 characters
          key input operations as follows;

          KEY1 (direct press) should display "1"
          F1 + KEY1 (simultaneous press) should display "a"
          F2 + KEY1 (simultaneous press) should display "b"
          F3 + KEY1 (simultaneous press) should display "c"

My problem is how should I develop this interface?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.