Re: [Question: Drivers/input/evdev.c] What is the use of write function in evdev_fops?

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

 



On Mon, Aug 18, 2014 at 7:27 AM, Peter Hutterer
<peter.hutterer@xxxxxxxxx> wrote:
> On Fri, Aug 15, 2014 at 02:01:48AM +0530, Aniroop Mathur wrote:
> [...]
>> >> >>
>> >> >>2 separate file descriptors like below ?
>> >> >>int fd1 = open("/dev/uinput", O_RDWR);
>> >> >>int fd2 = open("/dev/uinput", O_RDWR);
>> >> >>
>> >> >>But my reading data will still come in struct input_event as mentioned
>> >> >>above.
>> >> >>It has only time, type, code and value.
>> >> >>So, how we can use bitmask here ?
>> >> >>
>> >> >>struct input_event {
>> >> >>struct timeval time;
>> >> >>__u16 type;
>> >> >>__u16 code;
>> >> >>__s32 value;
>> >> >> };
>> >> >
>> >> > By opening 2 fds you'll end up creating 2 separate input devices with separate evdev nodes, etc, so you will not mix up input events.
>> >> >
>> >> > I think at this time you should just try actually using uinput and that should clear things for you.
>> >> >
>> >>
>> >> Can you please explain what do you mean by separate evdev nodes ?
>> >> Do you mean two separate evdev nodes for uinput ?
>> >> But as we discussed before, there is only one node in case of uinput
>> >> i.e. /dev/uinput.
>> >
>> > Uinput allows to creating input devices driven from userspace. You can
>> > create as many separate input devices as you want by opening
>> > /dev/uinput several times since it creates a device per file descriptor.
>> > Each of these input devices will get evdev attached to it and will get
>> > it's own /dev/input/eventX node created.
>> >
>> > Really, please try using uinput, it will clear a lot if things for you.
>> > For example, see what http://www.freedesktop.org/wiki/Evemu/ does.
>> >
>>
>>
>> Thank you Mr. Torokhov for the discussion and answering my queries. :)
>> I will try to explore more.
>
> I recommend you look at libevdev if you're planning to use uinput. evemu
> uses that now too and it makes a whole bunch of stuff easier and less likely
> to go wrong.
> http://freedesktop.org/wiki/Software/libevdev/
>
> specifically:
> http://www.freedesktop.org/software/libevdev/doc/1.2/group__uinput.html
>
> Cheers,
>    Peter
>

Thanks a lot Mr. Peter for your suggestion and input for this query. :)

Have a good day !

Cheers,
Aniroop
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux