public inbox for gentoo-desktop@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-desktop] Question : How to set per-device mouse sensitivity
@ 2010-02-28 20:52 Mickael Chazaux
  2010-03-01 16:38 ` [gentoo-desktop] " Duncan
  0 siblings, 1 reply; 4+ messages in thread
From: Mickael Chazaux @ 2010-02-28 20:52 UTC (permalink / raw
  To: gentoo-desktop

Hi,

I have trouble setting the sensitivity of my mouse. Let me explain
what I try to achieve. I have two pointing devices, a touchpad and a
Bluetooth mouse. One is usable, the other is way too fast for me to be
usable. xf86-input-mouse has an interesting option, named
'Sensitivity' which basically multiplies the movement of the device by
a provided float. What I want to be able to do is to set the
sensitivity of my devices separately. (eg 1.0 for the touchpad, and
0.3 for the Bluetooth mouse). 'xset m' does not provide this
sensitivity parameter, and acceleration is already at 1.
To do that, I tried two methods : writing a xorg.conf, and using HAL rules.

Using xorg.conf to hardcode values for /dev/input/mouse1 and
/dev/input/mouse2 seemed to be a good approach at first, but in order
to make Xorg use the Sections, one has to enable AllowEmptyInput and
thus AutoAddDevices (from man xorg.conf)

AutoAddDevices is what makes HAL automatically adds devices (USB mice,
etc...) and I don't want to disable that.

So I tried to put this in /etc/hal/fdi/policy/bt-mouse-speed.fdi :

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
        <match key="info.product" string="Bluetooth Laser Travel Mouse">
               <merge key="input.x11_options.Sensitivity"
type="string">0.1</merge>
        </match>
    </match>
  </device>
</deviceinfo>

lshal says that about my mouse :

udi = '/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e_logicaldev_input'
  info.capabilities = {'input', 'input.mouse'} (string list)
  info.category = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e'  (string)
  info.product = 'Bluetooth Laser Travel Mouse'  (string)
  info.subsystem = 'input'  (string)
  info.udi = '/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e_logicaldev_input'
 (string)
  input.device = '/dev/input/event12'  (string)
  input.originating_device =
'/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e'  (string)
  input.product = 'Bluetooth Laser Travel Mouse'  (string)
  input.x11_driver = 'evdev'  (string)
  linux.device_file = '/dev/input/event12'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.sysfs_path =
'/sys/devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.0/bluetooth/hci0/hci0:11/input16/event12'
 (string)


I don't have a big experience in writing hal rules, and I can't figure
out why they don't work as expected. That's why I ask this question
here :
How can I set the mouse sensitivity on a per-device basis?

Thanks for your attention,

Mickael



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-desktop] Re: Question : How to set per-device mouse sensitivity
  2010-02-28 20:52 [gentoo-desktop] Question : How to set per-device mouse sensitivity Mickael Chazaux
@ 2010-03-01 16:38 ` Duncan
  2010-03-01 18:56   ` Mickael Chazaux
  0 siblings, 1 reply; 4+ messages in thread
From: Duncan @ 2010-03-01 16:38 UTC (permalink / raw
  To: gentoo-desktop

Mickael Chazaux posted on Sun, 28 Feb 2010 21:52:12 +0100 as excerpted:

> I have two pointing devices, a touchpad and a Bluetooth mouse. One is
> usable, the other is way too fast for me to be usable. xf86-input-mouse
> has an interesting option, named 'Sensitivity' which basically
> multiplies the movement of the device by a provided float. What I want
> to be able to do is to set the sensitivity of my devices separately. (eg
> 1.0 for the touchpad, and 0.3 for the Bluetooth mouse). 'xset m' does
> not provide this sensitivity parameter, and acceleration is already at
> 1. To do that, I tried two methods : writing a xorg.conf, and using HAL
> rules.
> 
> Using xorg.conf to hardcode values for /dev/input/mouse1 and
> /dev/input/mouse2 seemed to be a good approach at first, but in order to
> make Xorg use the Sections, one has to enable AllowEmptyInput and thus
> AutoAddDevices (from man xorg.conf)
> 
> AutoAddDevices is what makes HAL automatically adds devices (USB mice,
> etc...) and I don't want to disable that.

Yeah, that's a problem there...

> So I tried to put this in /etc/hal/fdi/policy/bt-mouse-speed.fdi :
> 
> <?xml version="1.0" encoding="ISO-8859-1"?> <deviceinfo version="0.2">
>   <device>
>         <match key="info.product" string="Bluetooth Laser Travel Mouse">
>                <merge key="input.x11_options.Sensitivity"
> type="string">0.1</merge>
>         </match>
>     </match>
>   </device>
> </deviceinfo>
> 
> lshal says that about my mouse :
> 
> udi =
> '/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e_logicaldev_input'
>   info.capabilities = {'input', 'input.mouse'} (string list)
>   info.category = 'input'  (string)
>   info.parent = '/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e' 
> (string)
>   info.product = 'Bluetooth Laser Travel Mouse'  (string)
>   info.subsystem = 'input'  (string)
>   info.udi =
> '/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e_logicaldev_input'
> (string)
>   input.device = '/dev/input/event12'  (string)
>   input.originating_device =
> '/org/freedesktop/Hal/devices/bluetooth_acl_761ea325e'  (string)
>   input.product = 'Bluetooth Laser Travel Mouse'  (string)
>   input.x11_driver = 'evdev'  (string)
>   linux.device_file = '/dev/input/event12'  (string)
>   linux.hotplug_type = 2  (0x2)  (int)
>   linux.subsystem = 'input'  (string)
>   linux.sysfs_path =
> '/sys/devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.0/bluetooth/hci0/
> hci0:11/input16/event12'  (string)
> 
> 
> I don't have a big experience in writing hal rules, and I can't figure
> out why they don't work as expected. That's why I ask this question here
> :
> How can I set the mouse sensitivity on a per-device basis?

Note that the hal default is evdev for both mice and keyboards.  See that 
input.x11_driver parameter?  evdev.  Yet you don't say anything about 
whether evdev has that same sensitivity parameter.

Checking the evdev manpage, I don't see anything like that, BUT...

Checking the xorg.conf manpage, InputDevice section, I see the 
"ConstantDeceleration" option.  That looks to be what you want.  (FWIW, 
those are the manpages for xorg-server-1.7.5.  If you're on stable you'll 
likely be rather more stale than that, as of a week or so ago when I last 
synced... equery says latest stable is 1.6.5-r1.

Then, as you were already doing above, you can use an x11_options based 
key in your *.fdi.

The other alternative would be to use the (probably compressed)
use-mouse-driver.fdi file from hal's doc dir (/usr/share/doc/hal-
version/), to switch to the mouse driver instead of the evdev driver.  But 
that's discouraged as a last resort.  However, since hal is deprecated and 
they're eventually switching to something else anyway, it may be that just 
using the mouse driver until hal itself goes away is a reasonable solution.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-desktop] Re: Question : How to set per-device mouse  sensitivity
  2010-03-01 16:38 ` [gentoo-desktop] " Duncan
@ 2010-03-01 18:56   ` Mickael Chazaux
  2010-03-02  0:04     ` Duncan
  0 siblings, 1 reply; 4+ messages in thread
From: Mickael Chazaux @ 2010-03-01 18:56 UTC (permalink / raw
  To: gentoo-desktop

Hi,

I understood what went wrong.

>> So I tried to put this in /etc/hal/fdi/policy/bt-mouse-speed.fdi :
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?> <deviceinfo version="0.2">
>>   <device>
>>         <match key="info.product" string="Bluetooth Laser Travel Mouse">
>>                <merge key="input.x11_options.Sensitivity"
>> type="string">0.1</merge>
>>         </match>
>>     </match>
>>   </device>
>> </deviceinfo>
>>

This XML fragment is not valid : there is an extra </match>. That's
why HAL did not use it and drove me nuts for hours. FDI files may be
validated against /usr/share/hal/fdi/fdi.dtd

> Note that the hal default is evdev for both mice and keyboards.  See that
> input.x11_driver parameter?  evdev.  Yet you don't say anything about
> whether evdev has that same sensitivity parameter.

I did not realized until your last message that data put in fdi files
is reported by lshal... It helps a lot!

> Checking the evdev manpage, I don't see anything like that, BUT...
>
> Checking the xorg.conf manpage, InputDevice section, I see the
> "ConstantDeceleration" option.  That looks to be what you want.

Yes ! ;-)

> Then, as you were already doing above, you can use an x11_options based
> key in your *.fdi.

That's what I did, and it works well. Here is the fdi file I finally wrote :

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
        <match key="info.product" contains="Bluetooth Laser Travel Mouse">
               <merge key="input.x11_options.ConstantDeceleration"
type="string">2</merge>
               <merge key="input.x11_options.AccelerationProfile"
type="string">-1</merge>
        </match>
  </device>
</deviceinfo>

Trap : Mouse speed decreases when ConstantDeceleration increases.

Thank you for your useful and fast reply,

Mickael



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-desktop] Re: Question : How to set per-device mouse  sensitivity
  2010-03-01 18:56   ` Mickael Chazaux
@ 2010-03-02  0:04     ` Duncan
  0 siblings, 0 replies; 4+ messages in thread
From: Duncan @ 2010-03-02  0:04 UTC (permalink / raw
  To: gentoo-desktop

Mickael Chazaux posted on Mon, 01 Mar 2010 19:56:23 +0100 as excerpted:

> This XML fragment is not valid : there is an extra </match>. That's why
> HAL did not use it and drove me nuts for hours. FDI files may be
> validated against /usr/share/hal/fdi/fdi.dtd

Hmm.  I didn't spot that.  Thanks for reminding me to look for those.

Looks like between what I spotted, tho, and that, you have it working 
now.  =:^)  Thanks for the fix report.

I had set some special settings for the keyboard on my desktop, but I 
hadn't tried anything for the mouse, at least not with evdev.  On my 
netbook I have the syntouch driver loaded, and I had done some *.fdi 
editing for it, but that's not evdev mice.  I had thought about trying to 
create an fdi file to set separate accel for a usb mouse plugged into the 
netbook, but hadn't actually tried it yet.  So now you've confirmed that 
it should work with separate settings for each mouse device, giving me 
that info to use if I decide to try it here.

So the help went both ways, and I can thank you too. =:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-02  1:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-28 20:52 [gentoo-desktop] Question : How to set per-device mouse sensitivity Mickael Chazaux
2010-03-01 16:38 ` [gentoo-desktop] " Duncan
2010-03-01 18:56   ` Mickael Chazaux
2010-03-02  0:04     ` Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox