Results 1 to 3 of 3

Thread: Kernel module small question

  1. #1
    Join Date
    Mar 2008
    Beans
    136
    Distro
    Ubuntu 9.10 Karmic Koala

    Post Kernel module small question

    hello everyone...
    I'm working on a kernel module for my laptop buttons, and every thing is working just fine.

    my module generates input events using key codes #defined in linux/input.h BTN_0-BTN_7 0x100-0x107 like this:

    PHP Code:
    set_bit(EV_KEYbutton_dev->evbit);
    set_bit(BTN_0button_dev->keybit);
    ....

    //interrupt handler code:
    ...
    input_report_key(button_devBTN_01);
    ... 
    The problem is how do I map these input events to shell commands ?

    I mean there must be a daemon or something that I can use to set the mapping but I can't seem to find something like this , or do I need to write it myself ?

    Thanks for your time...
    "Oh, yeah, real smart. Let's go poking around inside a pod that's probably carrying a half-dozen miniature face-hugging, saliva-dripping alien piranha things. And while we're at it, let's split up so that we're all alone and defenseless, okay?" SQ6.

  2. #2
    Join Date
    Mar 2008
    Beans
    136
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Kernel module small question

    anyone ?

    I also can't find detailed documentation about the input device subsystem, if you can post some links that would be great.
    "Oh, yeah, real smart. Let's go poking around inside a pod that's probably carrying a half-dozen miniature face-hugging, saliva-dripping alien piranha things. And while we're at it, let's split up so that we're all alone and defenseless, okay?" SQ6.

  3. #3
    Join Date
    Mar 2008
    Beans
    136
    Distro
    Ubuntu 9.10 Karmic Koala

    Lightbulb Re: Kernel module small question

    I just used
    PHP Code:
    set_bit(KEY_*, button_dev->keybit); 
    instead, and now I can see the key codes with xev.

    here's a link to the module if anyone's interested.

    https://sourceforge.net/projects/lt20button
    "Oh, yeah, real smart. Let's go poking around inside a pod that's probably carrying a half-dozen miniature face-hugging, saliva-dripping alien piranha things. And while we're at it, let's split up so that we're all alone and defenseless, okay?" SQ6.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •