lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080425142224.ZZRA012@mailhub.coreip.homeip.net>
Date:	Fri, 25 Apr 2008 14:26:13 -0400
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Yan Seiner <yan@...ner.com>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: uinput question

Hi Yan,

On Sun, Apr 20, 2008 at 04:32:36PM -0700, Yan Seiner wrote:
> I'm trying to set up a system with multiple IR remotes acting as keyboards 
> for specific X sessions.
>
> lirc <http://www.lirc.org> is a way to send infrared remote keystrokes to 
> applications.  Some time ago I wrote a small patch to kbdd 
> <http://handhelds.org/moin/moin.cgi/kbdd> that lets me inject button pushes 
> on an IR remote into the /dev/input/uinput system as keyboard events.
>
> Now I'd like to send those keyboard events to only one X session, not all 
> of them.
>
> In the kbdd code, there is the following snippet when the /dev/input/uinput 
> device is opened:
>
>        memset(&dev, 0, sizeof(dev));
>        strncpy(dev.name, "SerKBD", UINPUT_MAX_NAME_SIZE);
>        dev.idbus = BUS_RS232;
>        dev.idvendor = 0x00;
>        dev.idproduct = 0x00;
>        dev.idversion = 0x00;
>
> So this would indicate to me that I can emulate different devices by 
> changing the names, IDs, and events.  Then I want to select only those 
> events that pertain to my app... 
> So...
> -   Create a 'virtual' eventNN device based on the data fed to kbdd
> -   Send various keyboard events to the kernel via the uinput device from 
> several physical devices
> -   Select only those events destined for my virtual device
> -   Have those events pop out of my eventNN device so I can handle them 
> back in userspace
>

You would need to set up uinput instance for every set of remotes you
want to send events to a particular X instance and then make X use
evdev driver to listen to the input events coming from 'their'
/dev/input/eventXX. You may need to teach X not to release event
device when switching vts so events from the uinput-connected devices
never reach the standard consolde driver.

Hope this helps.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ