Re: EV_MSC / driver/input/input.c (Input Handler)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/8/07, Frank Salomon <[email protected]> wrote:
Hi All,

I had written an additional input_handler :

     static struct input_device_id pcraw_ids[] = {
            {
                     .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
                     .evbit = { BIT(EV_MSC) },
             },
            { },    /* Terminating entry */
     };

to get MSC_RAW events from the atkeyboard :

     input_event (&atkbd->dev, EV_MSC, MSC_RAW, code)

But I only get these events :

     input_event(&atkbd->dev, EV_MSC, MSC_SCAN, code);


That is because by default atkbd uses software-emulated raw mode.
bootk with atkbd.softraw=0 or switch it off after boot through sysfs
attribute to get EV_MSC/MSC_RAW passed through).

I know the reason is in driver/input/input.c :

     case EV_MSC:
          if (code > MSC_MAX || !test_bit(code, dev->mscbit))
               return;

          if (dev->event) dev->event(dev, type, code, value);
          break;

because of (driver/input/keyboard/atkbd.c):

     atkbd->dev.mscbit[0] = atkbd->softraw ? BIT(MSC_SCAN) :
          BIT(MSC_RAW) | BIT(MSC_SCAN);

I would like to change driver/input/input.c like this :

     case EV_MSC:
          if (code > MSC_MAX)
               return;

          if (test_bit(code, dev->mscbit))
               if (dev->event) dev->event(dev, type, code, value);
          break;

Any comments ? Maybe I misunderstand the concept of the input events. In
that case, please give me a short description or let me know were I can
find any documentation.


No, input core should not pass any events device did not claim to support.

What are you trying to do though? Why are you interested in raw atkbd
events? What will your handler do with events from other input devices
that might emit raw events?

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux