unintentional double clicking

Monkey Forums/Monkey Programming/unintentional double clicking

Jeit(Posted 2012) [#1]
While testing my code I've discovered every single time I click, it double clicks. I have no idea what's causing it. I am using diddy, and have the MouseHit() in the update method of the gamescreen. Any help would be appreciated.


therevills(Posted 2012) [#2]
Try using game.mouseHit:
[monkeycode]If game.mouseHit Then Print "Click"[/monkeycode]
instead of MouseHit()?


Jeit(Posted 2012) [#3]
It still does it >.< Any other information you need? I truly don't even know what to post. I have a series of three clicks in bringing in an enemy in this level editor and have it set up to debuglog each click as "1" "2" or "3", it always says 1, 2 or 3, 1 (and for completeness sake 2, 3).


therevills(Posted 2012) [#4]
Can you post your input code?


Jeit(Posted 2012) [#5]
Within GameScreen

Method Update:Void()
if MouseHit()
DebugLog "clicked"
EndIf
End

Within the top file there is ReadInputs() in the OnUpdate(), that when commented out didn't change anything

God I bet that's helpful, sad thing is, as far as I can tell that's everything pertinent.


therevills(Posted 2012) [#6]
Are you using the Fixed Rate Logic (FRL) stuff?


Jeit(Posted 2012) [#7]
I figured it out (kind of), some code my boss wrote in the top file was messing it up, going to get him to look at it tomorrow. Thanks for trying to help, I just didn't (and still don't) understand this code, but once edited out it single clicks.
EDIT: Yeah, its to do with the fixed rate logic


andrew_r(Posted 2012) [#8]
Yes it's using the fixed rate logic stuff...

I think I ran into problems with an earlier version of the diddy framework, and modified the fixed-rate part to work slightly differently (with regards to timing). I didn't touch the input stuff though.

Andrew


therevills(Posted 2012) [#9]
and modified the fixed-rate part to work slightly differently (with regards to timing).

Want to share your changes?


andrew_r(Posted 2012) [#10]
Of course! Let me fix whatever broke for the update first (or attempt to).

I'm away from home right now, but I should be able to get to it this week.

Are/were there any known problems with the fixed rate stuff?


therevills(Posted 2012) [#11]
Are/were there any known problems with the fixed rate stuff?


It wasnt really tested a lot. I quickly added it to help with my fast collisions with a platformer example but that was using keyboard controls.

I believe the main issue with the FRL and mouse clicking is that the FRL is based on the GAF framework which of course is written with BlitzMax in mind and the mouse/key clicks are handled differently in Monkey...


andrew_r(Posted 2012) [#12]
That's why I had to modify it... platform games don't work too well with variable timing, and I didn't want to do the whole 'path of motion' thing.

I can't remember why I had to modify it originally, but there was a small bug in the fixed timing, if I recall correctly.

The whole mouseclick thing is new on me though :/