Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#347826 - 06/10/2011 21:37 Moving the mouse is different than moving the mouse? What the heck?
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
I've got this really weird thing I'm running into in my software testing that I don't understand at all. I'm wondering if any of the Windows devs on the board have seen this?

Preface: I spend my day mostly testing how our software interacts with other software and hardware on the same system. In this particular case, I'm testing our software against the Verizon VZ Access Manager (VZAM) software. (VZAM is what's called a "connection manager", the app you use to connect your wireless card to the wireless carrier). One of our tests is to make sure that our software is reading correct and current data (such as the RSSI signal strength) from the Verizon wireless card plugged into the system, and that our data generally agrees with the data VZAM gets. Our software talks directly to the card, just like VZAM talks directly to the card.

So I've got automation that screen-scrapes VZAM and reads the RSSI values from it. Later, the idea is to compare those values to the values that our software has recorded, to make sure that we don't have a bug in the way that we're reading the card's data.

But here's the funny thing. On one particular XP system, VZAM sometimes goes "stale", reporting the same RSSI value over and over again forever. If you know anything about wireless, you'll know that the signal strength constantly fluctuates, even for a device that's standing still. So a "stuck" RSSI is an indication that something's not functioning as expected, and is flagged for closer investigation.

I've discovered that, on that system, when VZAM is stuck in this state, if I move the mouse or use any keystrokes of any kind, then VZAM suddenly starts getting varying RSSI data again as expected.

Aha, so I says to myself. I simply need to edit my automation tool to do some mouse moves and keystrokes to get VZAM to refresh properly.

But here's the weird part!! I can write a program that does automated MouseMoves and clicks and keystrokes like crazy, and VZAM still stays stuck, as if I had never moved the mouse. I can sit there and watch my automation minimize and restore VZAM, watch the mouse pointer move to the corners of the application, and even watch the mouse pointer hover over the signal strength indicator to get a balloon pop-up showing me the raw RSSI values (which are still stuck at the same value). I can watch it do all of those things, over and over again for hours, no change.

And then, at any time, all I have to do is give the mouse, the physical mouse itself, the slightest little move, and bam, suddenly VZAM wakes up like a kid on Christmas morning and starts giving me fresh data. Same thing with a keystroke: I can press the exact same keys that my automation was already clearly doing with SendKeys commands. As soon as I physically press a key, suddenly everything works.

In other words, I have a program that responds differently to actual physical input than it does to simulated input. How is that even possible?

Here's a concrete example. If VZAM is in this "stuck" state I described... If I press CTRL-K in VZAM, it opens up the diagnostics window where I can see the raw RSSI values. If I do this via the actual physical keyboard, VZAM becomes unstuck and gives me fresh values. If I do this via a piece of software automation with SendKeys, the diagnostics window still opens (so I know that VZAM got the keystroke) but the values are stale, stuck at the same values they've been for the last hour.

It's the weirdest thing. How is it that this can be possible? From the Windows operating system level, what's different about sending keystrokes and mouse movements to an application physically versus via automation? Anyone know?
_________________________
Tony Fabris

Top
#347827 - 06/10/2011 21:46 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
It's interesting how sometimes you need to organize your thoughts by writing them down. Reading back over what I wrote above, I have a new theory to test: Maybe VZAM isn't the thing that's stuck. Maybe VZAM is right, and it's the card itself that's stuck, i.e., somehow the card or its drivers is responding to actual hardware idle time. I need to investigate that.
_________________________
Tony Fabris

Top
#347828 - 06/10/2011 22:02 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: tfabris]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
It's likely because this has nothing to do with the cursor movement or interpretation of keystrokes by software, but something to do with USB/HID. You won't see the issue (or the solution to your issue) until you exercise something on the bus itself - which could also include BlueTooth.

If you have any software that accesses some other USB device, try sending some traffic over an endpoint to see if you get the same results.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#347834 - 07/10/2011 01:54 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: hybrid8]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
I was going to suggest something with USB also. Your mouse/keyboard simulator won't be generating USB traffic

Can you test on another machine preferably with different USB hardware/drivers?

I assume the Verizon "card" is USB?
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#347860 - 07/10/2011 15:00 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: Shonky]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
Yeah, the Verizon card is USB. I'm going to head down this road of investigation. Thanks, guys!
_________________________
Tony Fabris

Top
#347867 - 07/10/2011 16:43 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I was actually thinking lower-level than that. It may just be that something is generating hardware interrupts. If the USB thing doesn't pan out, maybe play with something else that will generate interrupts, like a real COM port.
_________________________
Bitt Faulk

Top
#347901 - 08/10/2011 20:20 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: wfaulk]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
Alternative solution: small motor pressing and releasing the shift key wink

Top
#347915 - 09/10/2011 14:57 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: altman]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Or maybe a dippy bird?
_________________________
Bitt Faulk

Top
#347921 - 09/10/2011 19:36 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: wfaulk]
Phoenix42
veteran

Registered: 21/03/2002
Posts: 1424
Loc: MA but Irish born
If it is good enough for Homer...
http://www.youtube.com/watch?v=oQkSOcPLfP4

Top
#347941 - 10/10/2011 14:41 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: wfaulk]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
An old CPU fan, with some white-out on only one of the fins, with the optical mouse sitting atop it, solves the issue.

But I still wonder why it happens at all in the first place.
_________________________
Tony Fabris

Top
#347947 - 10/10/2011 15:36 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: tfabris]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Your Verizon app is getting hung up on something. Software issue, USB driver issue, etc..
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#347967 - 11/10/2011 06:46 Re: Moving the mouse is different than moving the mouse? What the heck? [Re: tfabris]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: tfabris
An old CPU fan, with some white-out on only one of the fins, with the optical mouse sitting atop it, solves the issue.


+1.
_________________________
-- roger

Top