Re: [DIGImend-devel] Genius PenSketch 12x9 in Ubuntu Precise (12.04)
Brought to you by:
spb_nick
|
From: Nikolai K. <sp...@gm...> - 2012-07-26 06:27:59
|
Hi Viktoria, On 07/26/2012 08:53 AM, Viktoria S. wrote: > I have a look at this too. Based on this: http://www.reactivated.net/writing_udev_rules.html#basic > You can name devices like this too: > KERNEL=="hdb", NAME="my_spare_disk" This would name the device node. We need to change the event device name, which is retrieved with EVIOCGNAME ioctl. > But my question is how you want to identify the pen? > To me there are no diferences from the udev perspective between the mouse > and the pen. Take a look at the output of "sudo udevadm monitor --property" while plugging-in the tablet. Here is an excerpt from the output for Waltop Media Tablet 10.6" pen: KERNEL[519.062576] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/input/input18 (input) ABS=1000003 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/input/input18 EV=1b KEY=1c01 0 0 0 0 0 0 0 0 0 0 MODALIAS=input:b0003v172Fp0501e0110-e0,1,3,4,k140,14A,14B,14C,ra0,1,18,m4,lsfw MSC=10 NAME="WALTOP International Corp. Media Tablet" PHYS="usb-0000:00:1d.0-1/input0" PRODUCT=3/172f/501/110 PROP=0 SEQNUM=1444 SUBSYSTEM=input UDEV_LOG=3 UNIQ="" Evtest outputs this for the corresponding event device: Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0x172f product 0x501 version 0x110 Input device name: "WALTOP International Corp. Media Tablet" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 320 (BTN_TOOL_PEN) Event code 330 (BTN_TOUCH) Event code 331 (BTN_STYLUS) Event code 332 (BTN_STYLUS2) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 18000 Resolution 78 Event code 1 (ABS_Y) Value 0 Min 0 Max 11000 Resolution 78 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 1023 Event type 4 (EV_MSC) Event code 4 (MSC_SCAN) The udev properties include EV, KEY, ABS and MSC - these are values retrievable with the EVIOCGBIT ioctl (which is what evtest and evdev driver do). EV is the bitmask of supported event types, which are EV_SYN, EV_KEY, EV_ABS and EV_MSC. EV_KEY is the bitmask for supported keys, EV_ABS - absolute axes, EV_MSC - miscellaneous events. Take a look at "Using the Input Subsystem, Part II" from the Linux Journal: http://www.linuxjournal.com/node/6429/print, especially "Listing 6. Finding a Unique Identifier" My theory is that you can match against these properties in an udev rule. Sincerely, Nick |