• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

Can a faulty optical mouse effect keyboard function?

AgeGap

Master Poster
Joined
Jul 11, 2007
Messages
2,447
I have just replaced a faulty mouse and then the keyboard that I thought was playing up has come back to life. Does this sound reasonable? I thought that the keyboard would not be affected by a faulty mouse. I have had a quick google and can't find anything amongst the many weird and wonderful problems that a faulty mouse can cause.
 
Is it wireless, USB, PS2, Serial... ?

Actually, it really doesn't matter, there are plenty of ways that faulty hardware can impact other devices.

Wireless KB/Mouse, just interference to jaminate the other wireless things is all it takes, especially if they are from the same manufacturer and are SUPPOSED TO share time on the same radio frequencies.

USB, if they're both on the same hub and one is constantly spewing crap when it's not supposed to, then it can prevent another device from being 'heard'. If the USB stack gets fouled up, software won't be able to get at USB devices, either.

Windows might choke on input devices if one is spewing too much crap for the input queues to keep up. Especially considering mouse buttons generate keyboard events. Betcha didn't know that. So if the mouse is doing nothing but clicketa-clickety-click as fast as messages can come out of it, it could choke out other keyboard input.
 
Thanks, that explains it. They are both PS2, actually the mouse is USB but it is plugged into a USB to PS2 connector. It is a dual boot machine and Ubuntu started to act a bit weird, shutting down continuously and the cursor being erratic. First thing I thought is that I had some sort of virus. I then tried windows and strange things again.
Because both Keyboard and Mouse were not working properly I thought I had a motherboard problem.
Either that or the computer was possessed. I couldn't even get on-line to find a good exorcist.

Thanks
AgeGap
 
In all likelihood it's the PS/2 controller on your motherboard that is getting confused and ending up sending junk/nothing to the OS.

The chance of seeing the same effect on USB is virtually zero, although it would be theoretically possible for a malfunctioning USB device to bring down the whole USB stack if the stack couldn't deal with malformed data. Extremely unlikely on a modern OS.

As for the input queues in Windows "choking" because of too much input.. It's not going to happen with any version made in the last 10 years. It also is not true that the mouse generates keyboard events, they are seperate systems with seperate queues and seperate events. That being said, excessive input could overwhelm a program, but that would generally manifest itself as the program locking up.
 
In all likelihood it's the PS/2 controller on your motherboard that is getting confused and ending up sending junk/nothing to the OS.

Thanks.
That sounds reasonable.
I would have thought a cheap,optical no-name mouse that was forever getting it's tail jammed in a metal drawer would be a bit more reliable.
 
Well, first off it's Ubuntu he's complaining about. So at least we can pull up the PS/2 code to see what it does, if we want. In this particular case, (assuming GUI) the mouse is a generic driver device that the X server configures. If not in X, then you're looking at something configured by 'curses'.

http://www.kernel.org/

But regardless of UI and OS, if you can choke every application to death with messages whenever it gets input focus, you're not going to be able to do anything when the OS boots.

And in any OS, if the interrupt handling is completely busy handling interrupts (which is a common mode of failure with hardware issues), then unless you have a Tardus, you're not going to be patient enough to wait the 100 years or so for the computer to finish booting up, assuming it doesn't suffer additional failutes in the intervening century, which is likely.

As for 'uncrashable' stacks, hardware problems trump any software, no matter how well written. I've had too many snipe hunts debugging problems that came from bad hardware. A bad router/switch connected to one card can kill the network stack for all network cards on a machine. A USB or IEEE1394 device behaving badly can snuff the USB or firewire stack without much trouble. A bad SCSI device can take down the whole SCSI bus in a heartbeat.

Most hardware is based around strong assumptions about clocks. If 'random' things happen at odd intervals when not expected, the whole model typically breaks down, or manifests strange symptoms. This effect is usually amplified by software, because normally software is many orders of magnitude more complex than the hardware it's working with.

While a basic mouse might have a couple of mickey (yes, that's the term) counters, a register of bits for buttons, and some microcontoller to send the data up a serial interface to thecomputer in one of the numerous mouse protocols, there are typically a few thousand lines of code between that mouse and the higher level portion of the OS that recognizes 'Mouse'. Not least, a driver to sit on the computer's side of that serial (serial/USB/PS2) connection and listen for interrupts, receive the generated mouse events, decode them, and eventually make events of the motion, button presses and releases. Not to mention 'thunks' up from driver to OS level, interprocess communication, and any 'scheduling' the OS does assuming hundreds of events per second, rather than thousands. Usually there are fixed-length queues at the lower levels of this chain, since dynamically allocating heap isn't an option in driver-world, and it's these that get overflowed when hardware acts badly. The OS, typically on a schedule between process/thread-switches, goes and collects data from these queues and moves them to queues that ARE dynamically allocated. Now, if those input queues are ALWAYS full, which is statistically not expected, the OS will spend a lot of time allocating memory that can't be freed, so virtual memory will soon become involved, and now things are being swapped to the hard drive as the heap constantly grows. From here on, nothing gets serviced as often as it should, and other queues begin to overflow, and more memory is needed to keep up with them... and next thing you know, your Linux box is behaving as badly as a Windows machine.
 
It's a fraction of the amount of opcodes, some of it looped, that has to execute when a mouse event happens. It adds up quick.
 
That was actually my way of saying that the last sentence of your post makes it pointless to attempt to engage in any sort of discussion.
 
You mean the wise-ass crack about making Linux running like Windows?

Well, the question's answered (YES, peripheral hardware malfunctions can foul up the computer), so any discussion beyond that is off-topic, anyways.

From here on, nothing gets serviced as often as it should, and other queues begin to overflow, and more memory is needed to keep up with them... and next thing you know, your Linux box is behaving as badly as a Windows machine.

Hmm, sort of poor sentence structure. Kind of a run-on. Are you going all grammar nazi on me?
 
Not sure what you mean, Dancing.

A affects B. Verb.

A has an effect on B. Noun.

Yeah, yeah, as I admitted, it is not a big deal but it's just one of those things we each have that gets under our skin.
 
From Apple's built-in Dictionary:
effect |iˈfekt|
[...]
verb [ trans. ] (often be effected)
cause (something) to happen; bring about : nature always effected a cure | budget cuts that were quietly effected over four years.
and
USAGE Affect and effect are both verbs and nouns, but only effect is common as a noun, usually meaning 'a result, consequence, impression, etc.': : my father’s warnings had no effect on my adventurousness. The noun affect is restricted almost entirely to psychology (see affect 2). As verbs, they are used differently. Affect most commonly means 'produce an effect on, influence': : smoking during pregnancy can affect the baby's development. Affect also means 'pretend to have or feel (something)' (see affect 3): : she affected a concern for those who had lost their jobs. Effect means 'bring about': : the negotiators effected an agreement despite many difficulties.
You can use "effect" as a transitive verb: The mouse can effect changes in the keyboard's behavior. But that's uncommon usage.

It's common to say: "To affect means cause an effect". But the reverse is not completely wrong.
 
Last edited:
Could be worse!

At a 'Bed Bath & Beyond' that's going out of business, they posted signs saying "No coupons excepted" all over their doors and windows. What they meant is, 'We will accept no coupons'.

Only 10%~30% off, and it looks like they swapped all of what they had with all the tacky crap from the remaining stores to dispose of. Anyone need dark-green blankets, pillows and curtains with palm tree patterns? Go to Palm Desert!
 

Back
Top Bottom