Build Your Own Arcade Controls Forum

Main => Main Forum => Topic started by: tritonarcade on July 11, 2003, 04:30:09 pm

Title: Optipac and "double clicks"
Post by: tritonarcade on July 11, 2003, 04:30:09 pm
Is there any way to prevent my Optipac from clicking twice with a single button press?  I've got a trackball and two buttons hooked up to the Optipac, all to Player 1, and 80% of the time a single button press registers as an ultrafast double click in Windows.  I'm not sure yet if this will impact actual gameplay but it's annoying for working with Windows for sure..

There have been mentions of this phenomenon previously on this board but I haven't seen a solution posted.  Andy's response to another poster didn't appear to solve the problem either.   Thanks for your ideas!
Title: Re:Optipac and "double clicks"
Post by: Hoagie_one on July 11, 2003, 04:38:32 pm
try changing the double click speed in the control panel of windows
Title: Re:Optipac and "double clicks"
Post by: AlanS17 on July 11, 2003, 04:41:24 pm
Well if it's an "ultrafast" double click then changing the speed won't matter. It'll still double click. Have you checked your contacts on your microswitches? Have you checked that your wiring is tight and grounded properly?
Title: Re:Optipac and "double clicks"
Post by: Hoagie_one on July 11, 2003, 04:42:28 pm
Well if it's an "ultrafast" double click then changing the speed won't matter. It'll still double click.

Right, I was thinking backwards.  NM me
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 11, 2003, 06:01:29 pm
I can show you how to fix it...  you have to "debounce" the switch.  I'll look up the best way to do this.  (surprised the optipac isn't debounced already?  it really should be designed that way.  Unless yours has a missing / bad capacitor or something.)

I was wondering about whether I would have to do that, since I found the microswitches have a lot of bounce to them.  Guess now I know!
Title: Re:Optipac and "double clicks"
Post by: tritonarcade on July 11, 2003, 06:14:25 pm
Thanks Grafixmonkey, I would really appreciate that.  Looking forward to seeing how I can fix it.
Title: Re:Optipac and "double clicks"
Post by: tritonarcade on July 11, 2003, 06:17:56 pm
Well if it's an "ultrafast" double click then changing the speed won't matter. It'll still double click. Have you checked your contacts on your microswitches? Have you checked that your wiring is tight and grounded properly?

You bet as far as I can see everything is hooked up properly.  I've tried using another microswitch as well, no change.
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 12, 2003, 01:47:12 am
I had trouble with the toggle circuit I built because of switch bouncing (i.e. while building it - it does work now), so I'm fairly certain this is the trouble you're having.

I'm surprised not to have seen other posts about it, though I haven't been here all that long...   maybe it's only beginning to be an issue on newer computers?

Still have to look it up...  it's not really an intuitive kind of circuit so I want to make sure it's right.  Maybe by sunday.
Title: Re:Optipac and "double clicks"
Post by: u_rebelscum on July 12, 2003, 05:11:05 am
If you are using the USB optipac, first make sure the buttons and trackball are hooked up to the same player on the optipac (ie: both on player 1, or both on player 2).  Windows has some button "problems" if they are on different players: when the trackball moves, windows thinks no buttons are pressed.

Just for testing, try hooking the trackball and buttons to "player two" on the optipac.  Putting it on player 2 won't effect much*, but I heard some people have more problems with the player 1 button connections than player 2 button connections.  You'll need to move the trackball too because of above.

*Only effects you: on mame 0.69 and up, on win98 and winME systems, and you already remapped the mouse buttons thru the [tab] mame UI.  If you meet all the prior requirements, you'll most likely need to re-map the mouse buttons again.
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 12, 2003, 11:57:21 am

ok so maybe this isn't a bouncing issue after all...    ???   Not sure.
Does it double click when you position the pointer over an icon and press a button once?  Or does it do weird stuff when you drag icons?  or both?

And did anybody else have this problem?  My optipac isn't hooked up yet so I can't try for myself.
Title: Re:Optipac and "double clicks"
Post by: tritonarcade on July 14, 2003, 04:25:42 am
Yeah it will double click things randomly.. icons, menus (e.g. it will go through two menu screens with one click)..  

One thing I've found is that if the trackball is moving while I click the mouse button, it won't ever do this double click.  So it appears the problem is in the way the optipac is processing things.
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 15, 2003, 02:51:48 am
no that supports the bouncing theory actually.  If the pointer were moving while the button double clicked, then windows would probably get the clicks on separate pixel locations, and register separate clicks instead of doubles.   (try double clicking while moving the mouse.)

Located a friend who remembers the debouncing circuit.  I'll post it tomorrow for everyone.
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 15, 2003, 10:48:33 pm
ok here's my fix.  I don't have an oscilloscope so I can't check if it really does its job, but it looks like it should.  Not too much wiring either.

You need:  
  *   A TTL NAND gate chip:   7400  (pref. 74LS00, usually marked SN74LS00N).  One for every two switches.
  *   Resistors.  About 1 Kohm, or 1000 ohms.  (code:  brown-black-red)   1/4 watt is fine.  Two for every switch.
  *   Something to put it on.  Either protoboard, or a project board you can solder to.


Here's the schematic.  The top one is a gate representation.  For the people who haven't dealt with gates before, the boxy things with one flat and one rounded edge, with a bubble on rounded side, represent NAND gates.  The bottom one is a diagram of how to wire it up.  

Note that the bottom diagram has two microswitches on it.  That's how to wire two switches to one chip.  If you're only wiring one of them, just ignore the right hand side of the chip entirely (except for wiring the top right pin to 5v power - that must be there or the chip won't work.)

EDIT:  I do believe they sell 7400 chips at Radio Shack.  More expensive than anywhere else, but not too bad for only buying one or two.
Title: Re:Optipac and "double clicks"
Post by: tritonarcade on July 16, 2003, 05:39:49 am
Awesome work grafixmonkey - THANKS!  I will definitely wire this into my optipac and post my results.
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 16, 2003, 12:17:16 pm
awesome, then I'll know what to expect when I wire mine up in a few days.  ;)
Title: Re:Optipac and "double clicks"
Post by: OSCAR on July 16, 2003, 12:26:21 pm
Sorry that I'm late to the party, but has anyone else ever had this problem with an Opti-PAC, or found it necessary to add the de-bounce circuit?  I've used one for quite some time and never experienced any double-clicking or other problems.

Tritonarcade - did you "bounce" ( :P) this problem off of Andy, and if so, did he recommend building a circuit to fix it?  This looks like putting on a full suit of armor to attack a hot fudge sundae to me.  Then again, it's not me having the problem and you are probably willing to try anything to get rid of it, which is understandable, I've been there...

Title: Re:Optipac and "double clicks"
Post by: rampy on July 16, 2003, 12:28:01 pm
Did you guys think to ask Andy for support on this issue with your optipac?

Just a thought/idea... he might have an "oh doh! didn't check/think of that" solution.

I'd be surprised if the optipac needed a separate circuit to work normally... i.e. my *guess* is that it's probably somethign else.  My first thought is make sure you didn't wire to NC tab of your microswitches, but i'm not even sure how/why that would effect it... *shrug*

Rampy
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 16, 2003, 03:08:10 pm
I dunno, It sounded like a switch bouncing problem so I just found an old lab manual and posted a circuit.  It doesn't seem right to me either, but I thought hey we've moved to pc's with USB 2.0, and they are a heck of a lot faster than 500 MHz now, so something might have changed.

If he wired to the NC contact, I'd think his mouse would be permanently dragging, same as just holding down the mouse button all the time...   and if it was a moving-while-clicking problem, I'd think clicking the button while the trackball is standing still would be fine...

Or maybe I'm just clinically addicted to TTL chips!   ::)
Title: Re:Optipac and "double clicks"
Post by: tritonarcade on July 16, 2003, 06:50:09 pm
Yeah, I'm definitely wired up correctly to the NO switch.  My reason for not emailing Andy was based in a response he gave another user on this forum to the same problem, something along the lines of "hmmm, I've had someone else email me with a similar problem, try switching the jumper to serial mode to see if that solves the problem".  I did and it unfortunately didn't.. He does list the Optipac as having internal debouncing programming...

I'll email him as soon as I get the chance to see if he can take a look at this thread to offer his input.
Title: Re:Optipac and "double clicks"
Post by: grafixmonkey on July 16, 2003, 10:51:43 pm
I looked at the Ipac and Optipac a couple times before...   they're not in front of me right now so I can't look real close, but I didn't see anything on them that could be used for debouncing switches, unless it's somehow done in software, like maybe ignoring really quick repeated presses.  It may easily be that debouncing inputs added a lot of board space and cost, and wasn't a problem often enough to matter.

I'll look more closely when I get home, but so far this is pretty likely to solve the problem, and it's pretty bite size wiring for one or two switches.  If the problem is bouncing, it could be that it's a rare problem with only certain switches.

Not to diss the optipac design, it's pretty nice.  
Title: Re:Optipac and "double clicks"
Post by: tritonarcade on July 17, 2003, 03:54:19 am
Hmm.. according to the ultimarc Web site, a "debounce" function is listed on the IPAC feature list but not on the Optipac.  I emailed Andy tonight, hopefully he can post the final word on the matter.
Title: Re:Optipac and "double clicks"
Post by: AndyWarne on July 17, 2003, 05:47:44 am
Hi,

I missed this thread...

The problem is this:

Under Windows 98, both mouse devices which the Opti-PAC presents to Windows appear as individual devices (unlike XP, that's why 2-player Analog+ only works in 98). So there is a problem with interaction, although the button of one mouse is pressed, the other one is not, and a conflict occurs.
I made a code change a few weeks ago to cure this. Note that this problem only happens in Win98 and it's only relevant to mouse buttons hooked up to the Opti-PAC. (many people don't use the mouse button connections).
If anyone is seeing this problem I will need to send a replacement chip, drop me an email.
Yes the buttons are debounced. You definitely don't need any circuitry!

Andy
Title: Re:Optipac and "double clicks"
Post by: MrBond on July 17, 2003, 11:55:10 pm
has anyone else ever had this problem with an Opti-PAC

Yeah, actually I've been meaning to start a thread here about this problem.  I am using a usb connected optipac with a trackball, spinner, and left and right mouse buttons wired up.  Everything works great, except for this "really fast" double click.  Oh, I'm using Win XP, so I'm not quite sure your fix will work on mine Andy. ???
The only time I really notice this is in windows.  However, recently I've been addicted to a PC game I run off my cab, Laser Age...it's a free full shooter game: http://www.pcgameworld.com/details.php/id/83/
It uses the mouse + left mouse button, and when I press and hold the left mouse button, it fires twice.
But really the annoyance is in windows when I go to drag a box and then copy multiple files...it is impossible to click on one file and maintain the "highlight" on the other files.  Also I've noticed when I hit the "back" button and it goes back twice.

Andy, is this fixable in XP?

Thanks!
Title: Re:Optipac and "double clicks"
Post by: MrBond on July 18, 2003, 07:11:33 pm
I just may have figured this out myself.  I just started fiddling with the optipac to see what would happen.  After some field work (I even unplugged my light gun harness just to check), I figured out that if both "left mouse button" input terminals were activated, then it would work correctly.  I made a "Y" with the wire, going from the push button into the Y, and then into both left mouse screw terminals.  It seems to work fine now!!!  I will probably do the same with my right mouse button.
BTW, I tried only the other left mouse button input first, and that resulted in me not being able to click and hold the mouse button at all.  But if both are activated, it works fine.
 
I have no idea why this works, something with the 1 player/2 player inputs?
Title: Re:Optipac and "double clicks"
Post by: tritonarcade on July 18, 2003, 07:25:07 pm
It sounds like Andy's code checks for inputs from both left click buttons, and if the second isn't found it results in a very short break in the "click" signal, resulting in the double click.  That's my rudimentary guess anyway. :)