Top.Mail.Ru
? ?
brad's life [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Linux input layer: trackpad to scroll event daemon [May. 25th, 2005|03:14 pm]
Brad Fitzpatrick
[Tags|]

So I'm using my special keyboard again, after finally getting around to mounting it. It's great-- I can lean back in my chair and hack comfortably, wrists naturally positioned at my sides.

But I have no scrollwheel, and no middle mouse button. But I have two trackpads, one per hand, each with two mouse buttons. And I never use the left one!

So......

Linux 2.6 has a really nice input layer. I'm thinking I write a daemon (or you tell me of one!) that reads the mouse input events from the left touchpad (they show up as seperate devices) and translates all upwards motion into "scroll up" mouse clicks, and all downwards into "scroll down" mouse clicks. (scroll up/down are just mouse buttons, as far as the computer is concerned). SImilarly, I'll convert my left two trackpad buttons into "double click" and "middle click". Then this daemon will reinject its events into the kernel layer, where they'll get merged into /dev/input/mice or whatever for X to read.

Tell me where this already exists so I can use it. :-)
LinkReply

Comments:
[User Picture]From: waider
2005-05-25 10:20 pm (UTC)
If it's a synaptics pad, and there's a good chance that it is, you want the Synaptics X Touchpad driver which is the absolute business.
(Reply) (Thread)
[User Picture]From: brad
2005-05-25 10:24 pm (UTC)
It says "Glidepoint" on it.
(Reply) (Parent) (Thread)
[User Picture]From: johno
2005-05-25 10:29 pm (UTC)
3/4 down the page:


Can I use this driver with an ALPS Glidepoint device?

Yes, see the README.alps file included in the package for more information.
(Reply) (Parent) (Thread)
[User Picture]From: brad
2005-05-25 10:38 pm (UTC)
Hey, I did do a google search first to see if Glidepoint was a Synaptics product! Once the first couple links looked wrong, I gave up. :-)
(Reply) (Parent) (Thread)
[User Picture]From: waider
2005-05-25 10:42 pm (UTC)
I've been followed up already, but my understanding is that Synaptics basically own the applicable patents on touchpads sufficently to pretty much own the market - most touchpads are (apparently, take with a pinch of salt, research before retransmission, etc.) either rebranded Synaptics pads or licensed from Synaptics and sufficiently close to their API that they may as well be Synaptics. The driver I've referenced allows you to hook arbitrary button events to "scroll wheel" motion (i.e. running your finger along one side of the pad) so you could (in theory; I don't have the hardware to experiment with) set up the first pad as buttons 1-3 for the actual buttons, 4/5 for vert, 6/7 for horiz, and then set up 8/9 and 10/11 on the second pad. Some assembly may be required to make this sucker fly, but I believe you should at least be able to use the existing code as a basis if nothing else.
(Reply) (Parent) (Thread)
[User Picture]From: waider
2005-05-25 10:44 pm (UTC)
Just to add, in case it's not obvious, I do actually have one Synaptics device, and I have used - in fact, am currently using - the driver. I'm not just, you know, paraphrasing the page or some equally dumb-ass thing.
(Reply) (Parent) (Thread)
[User Picture]From: livejamie
2005-05-25 10:23 pm (UTC)
weird.
(Reply) (Thread)
[User Picture]From: pianodude34
2005-05-25 10:47 pm (UTC)
That keyboard's awesome! Where'd you get it/how much did it cost?
(Reply) (Thread)
[User Picture]From: brad
2005-05-25 11:12 pm (UTC)
Kinesis.com. Forget what I paid.
(Reply) (Parent) (Thread)
[User Picture]From: scosol
2005-05-26 08:07 am (UTC)
hmm- too bad they dont make one that ditches the trackpads in exchange for just a built-in mouse surface off to the right- then i'd buy one
(Reply) (Parent) (Thread)
[User Picture]From: taral
2005-05-25 11:32 pm (UTC)
No can do. /dev/input/mice is a synthetic device providing all of the events from /dev/input/mouse*. What you want would require creating a FIFO that you point X to, then having a daemon feed the FIFO while reading /dev/input/mouse[01].
(Reply) (Thread)
[User Picture]From: brad
2005-05-25 11:42 pm (UTC)
Yeah, I quickly found that out. I was confusing the user events config option with the ability to inject events into that synthetic device.

In any case, a FIFO should be easy to do.
(Reply) (Parent) (Thread)
[User Picture]From: jproulx
2005-05-26 12:13 am (UTC)
Why not just deck out your geek captain's helm with a productivity-maximizing programmable foot switch?

http://www.kinesis-ergo.com/fs-savant.htm

Better yet, hardwire a switch in your chair that registers a clicks when you rock back and forth.
(Reply) (Thread)
From: evan
2005-05-26 01:15 am (UTC)
i know it's already been said, but brilliant icon.
(Reply) (Parent) (Thread)
From: nathanmock
2005-05-26 02:02 am (UTC)
lol talk about ultimate lazyness.
(Reply) (Thread)
[User Picture]From: brad
2005-05-26 02:22 am (UTC)
Talk about I've been typing for 20 years and my wrists fucking hurt.
(Reply) (Parent) (Thread)
[User Picture]From: nikitab
2005-05-30 04:50 pm (UTC)
Ever played with a frogpad? Might help out given the variety of intput.

Also, my hands are starting to hurt too a little and I found that using a tablet relaxes the hand quite a bit.
(Reply) (Parent) (Thread)
[User Picture]From: illikaeri
2005-05-26 03:06 am (UTC)
That's gotta be the most kick-ass chair I've ever seen.

Makes me want one!
(Reply) (Thread)
[User Picture]From: brad
2005-05-26 05:02 am (UTC)
I actually have a better chair (an Aeron chair, of course!). The keyboard attaches to any standard office chair with 4" bolts under the armrests.
(Reply) (Parent) (Thread)
[User Picture]From: eaterofhands
2005-05-26 06:29 am (UTC)

is it that good?

Is the Aeron chair really as good as the hype? I'm planning on ordering a chair at work soon and like Herman Miller for their sustainable business practices, but wouldn't compromise on comfort. Having the right chair may finally keep my from pulling my knee up to my chest and letting my leg fall out while typing. Not the best posture I know :(
(Reply) (Parent) (Thread)
[User Picture]From: brad
2005-05-26 06:34 am (UTC)

Re: is it that good?

I love it. Lets your butt air out.
(Reply) (Parent) (Thread)
[User Picture]From: eaterofhands
2005-05-26 06:38 am (UTC)

Re: is it that good?

Luckily I have no office mates downwind of me :)
(Reply) (Parent) (Thread)
From: (Anonymous)
2005-05-26 12:40 pm (UTC)

Re: is it that good?

Check out the Freedom Chair. No butt airing, but it is very comfortable.

http://www.humanscale.com/products/freedom_chair.cfm
(Reply) (Parent) (Thread)
[User Picture]From: illikaeri
2005-05-26 10:19 am (UTC)
One day I'll get a better chair, and I'll try not to destroy it, or let my pets destroy it. That's my only problem, they like to (try) eat my chairs.
(Reply) (Parent) (Thread)
[User Picture]From: astral
2005-05-26 08:52 am (UTC)
(Reply) (Thread)
[User Picture]From: avatraxiom
2005-05-26 03:27 pm (UTC)
I've never used imwheel, but I wonder if it could do that sort of thing.

-Max
(Reply) (Thread)