LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-22-2012, 02:09 PM   #1
milljunky
LQ Newbie
 
Registered: May 2012
Posts: 5

Rep: Reputation: Disabled
Lightbulb Filtering mouse wheel


Hi everyone!

I have a bluetooth mouse and since some time I'm experiencing an annoying issue.

When scrolling down (with the wheel) it sends some scroll up signals. I mean, scroll up is 4 and scroll down is 5. When scrolling down multiple times, what I get is something like 5 5 5 5 5 4 4 5 5 5 5 4 5 5 5... And, of course, the opposite when scrolling up. Something like 4 4 4 4 4 5 4 4 4...

It only happens when I scroll quickly, but in the everyday is really annoying, because the screen will do just the opposite to what you want.

OK, so I could just buy a new mouse, but I want to try to correct it programatically.

The easiest solution is to just disable one of the directions, and just use the wheel to scrool down (or up). I have already done that and the results aren't very pleasant.

The best solution, of course, would be to monitor the mouse input and check, through some algorithm if the signal is probably wrong. For example, if I have lots of 5 in a short period of time, and then a 4, so, probably this is another 5. How could I do that?

An easier solution could be always use the wheel in just one direction, and associate the opposite direction with the press of a button. For example, regardless of the direction I move the wheel, it will scroll down. However, if I move the wheel pressing the right button at the same time, it will scroll up.

So, how could I accomplish that? Or you have other good ideas to bypass that issue?

Thanks a lot!

Last edited by milljunky; 05-22-2012 at 02:11 PM.
 
Old 05-23-2012, 04:55 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by milljunky View Post
When scrolling down (with the wheel) it sends some scroll up signals. I mean, scroll up is 4 and scroll down is 5. When scrolling down multiple times, what I get is something like 5 5 5 5 5 4 4 5 5 5 5 4 5 5 5... And, of course, the opposite when scrolling up. Something like 4 4 4 4 4 5 4 4 4...
yes, I see. Easily happens with rotation detection, when the rotary speed exceeds the detection speed of the system.

Quote:
Originally Posted by milljunky View Post
The easiest solution is to just disable one of the directions, and just use the wheel to scrool down (or up). I have already done that and the results aren't very pleasant.
I wouldn't call that a solution.

Quote:
Originally Posted by milljunky View Post
The best solution, of course, would be to monitor the mouse input and check, through some algorithm if the signal is probably wrong. For example, if I have lots of 5 in a short period of time, and then a 4, so, probably this is another 5. How could I do that?
Exactly as you said: Whenever there's a "scroll up" or "scroll down" event, store it with a timestamp. When there's a scroll event with the opposite direction than the last one before, discard it if less than a minimum amount of time has elapsed. Otherwise, pass it along to the application. The time threshold (probably a few tenths of a second) could be a configurable parameter.

Quote:
Originally Posted by milljunky View Post
An easier solution could be always use the wheel in just one direction, and associate the opposite direction with the press of a button. For example, regardless of the direction I move the wheel, it will scroll down. However, if I move the wheel pressing the right button at the same time, it will scroll up.
You don't really want that, do you?

[X] Doc CPU
 
Old 05-23-2012, 09:36 AM   #3
milljunky
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you for the answer, Doc CPU.

But how can I implement that?

I guess I have to intercept the mouse signals before X and then pass to it the correct ones.
I'm just clueless in the implementation.
 
Old 05-23-2012, 09:53 AM   #4
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by milljunky View Post
But how can I implement that?

I guess I have to intercept the mouse signals before X and then pass to it the correct ones.
I'm just clueless in the implementation.
well, so am I, sorry. But you seemed so well-informed about the signaling from your mouse that I thought you had already tapped the command flow for examination, and it looked like all you needed was a proper algorithm.

[X] Doc CPU
 
Old 05-31-2012, 01:59 AM   #5
milljunky
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Anybody? =/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PS2 wheel mouse/wheel does not work kph56 Ubuntu 2 12-21-2010 08:42 PM
horizontal mouse wheel scrolling config in Slack 11 [evdev driver instead of mouse] arcanex Slackware 8 12-12-2007 07:18 AM
Kanotix: computer recognizes PS/2 optical wheel mouse, but mouse does not work.. karisu123 Linux - Hardware 1 01-02-2007 03:30 AM
PS2 wheel mouse/wheel not working jayhel Linux - Hardware 2 06-18-2006 06:54 PM
4d wheel mouse - scroll wheel no worky CamelofCamelot Linux - Hardware 1 10-28-2004 08:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration