1

I have a Logitech Wireless Touchpad I hope to use in a project. I am interested in using either of this device to drive a microscope stage. Ideally, I would have the touchpad hooked up with the computer, and its sole purpose would be to drive the stage, not function as a mouse. A regular mouse would be used to navigate through windows and my program's user interface.

Here's the problem: I'm not sure how to go about reconfiguring this device's functions. It almost seems like I would need to write a new driver for the touchpad. However, it sounds like writing a new driver for a device can be a huge undertaking with severe consequences if not done correctly. Having never written a driver before, I'm sure I would mess something up.

Here are my specific questions:

  1. Is writing a new driver necessary to reconfigure a mouse for other operations?

  2. If not, how could such reconfigurations be done? (Any method would be acceptable).

  3. Could I somehow simply read the data being output from the device to the computer in order to grab events to process?

Here's some other information that could prove helpful: I am programming in Python on Windows 7. I only really need to know the (x, y) coordinates being touched on the touchpad. Any help or suggestions are better than nothing. If this question needs improvement to be correctly answered, let me know! Thanks in advance!

Andrew Donelick
  • 173
  • 1
  • 2
  • 10

1 Answers1

1

​1. Is writing a new driver necessary to reconfigure a mouse for other operations?

No. You still need the same driver to read data from the mouse regardless of other issues.

​2. If not, how could such reconfigurations be done? (Any method would be acceptable).

You simply need to make the pointer not be a "core" device. Under Linux you simply tell xinput to detach it from the virtual core pointer under X.

$ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
⎜   ↳ Logitech USB-PS/2 Optical Mouse           id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ Acer CrystalEye webcam                    id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
$ xinput float 12
$ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ Acer CrystalEye webcam                    id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
∼ Logitech USB-PS/2 Optical Mouse           id=12   [floating slave]

I'm sure similar procedures exist on other operating systems.

​3. Could I somehow simply read the data being output from the device to the computer in order to grab events to process?

Absolutely. That's what the event subsystem (and its analogies on other OSes) is for.

Ignacio Vazquez-Abrams
  • 699,552
  • 132
  • 1,235
  • 1,283