Logitech mouse specifics handling

Andreas Schneider mail at cynapses.org
Sat Jun 9 04:42:45 PDT 2007


> Hija,

Hi,

sorry I'm late :)

> 
> as one of the SoC'07 students of the GNOME project, I'll be working on
> HID device handling in our desktop environment. One part of this is
> related to the X server (on-line addition of devices to the server),
> another inside the desktop, but obviously HAL will have an important
> role too.
> 
> One thing I'd like to handle is Logitech-specific mouse functions.
> Currently some other projects already provide these features (eg
> resolution setting), both Lomoco[1] and KDE[2].
> Adding this feature in the GNOME desktop too would imply more
> code/functionality duplication, including device/capability maps etc.

I'm currently rewriting lomoco from scratch as a library so that several
projects are able to use liblomoco.

> 
> So, I'd propose to add this functionality inside HAL (somewhat like the
> screen brightness functionality, etc).

I'm not sure if it is a good idea to integrate it in HAL and it isn't as
easy as you think. First there are 3 different tyes of Logitech devices:

Corded Mice
------------

Easy to support, can be configured with libusb or with a raw hiddev (G
series and the Revolution series)

Receivers
----------
A receiver is normally connected to a Mouse. It is possible that it is
connected to a keyboard and a mouse. A receiver has no capabilities.

Cordless Mice
--------------

A cordless mouse is connected to a receiver. Normally it has no product
ID, it has a receiver ID and it can have two different rids. Cause it
could be on the second channel if it has a keyboard connected two.
There are different cordless mice shipped with the same receiver so you
have to ask the receiver for the rid and check which cordless mouse is
attached.

Newer devices like the VX Revolution have a second hid device so they
have a pid.

> The way I see this:
> - Add a new device capability, input.mouse.logitech
> - On devices with this capability, add these properties and methods:
> 	* int BatteryLevel
> 	* int[] SupportedResolutions
> 	* int Resolution
> 	* bool DualChannelSupported
> 	* int Channel
> 	* setResolution(int)
> 	* setChannel(int)

typedef struct logitech_device_s {
  /** Name of the mouse */
  char name[128];
  /** Product ID */
  int pid;
  /** Device type  */
  int type;
  /** Receiver id of the mouse */
  int rid;
  /** Receiver id of the mouse on 2nd channel */
  int rid2;
  /** Maximum resolution */
  int max_res;
  /** Minimum resolution */
  int min_res;
  /** Resolution step */
  int step;
  /** Smart control reporting */
  int ssr;
  /** Smart control support */
  int sms;
  /** Free Spin control */
  int fsp;
  /** Click-to-Click control */
  int ctc;
  /** Has a second hiddev */
  int hiddev;
  /** Dual receiver */
  int dual;
} logitech_device_t;

This is the current struct I use. It will change soon but it gives an
overview what you need.

> 
> This API is just a sample, obviously, and should follow the HAL
> standards. Device-specific capabilities which can't be queried from the
> mouse itself could be stored in FDI files.
> 
> Next to this, info.product/input.product could become a more specific
> string too (although this might be handled in some other place, I'm not
> very familiar with the low-level input stack yet), FDI based.
> 
> Any ideas on this? Or should this not be handled in HAL at all?

I don't know if it should be handled by HAL. HAL is already linked to
libusb it would be possible to integrate it. It would be great to have a
 decision as soon as possible. Then I would stop developing on lomoco
and look into HAL or continue the work on liblomoco.

> 
> Thanks,
> 
> Nicolas

Best regards,

	-- andreas

> 
> [1] http://lomoco.linux-gamers.net/
> [2] Couldn't find the file in KDE's websvn, see
> kcontrol/input/logitechmouse* in your local kdebase tarball



-- 
http://www.cynapses.org/ - cybernetic synapses


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/hal/attachments/20070609/c8a4c014/attachment.pgp 


More information about the hal mailing list