So if you have a similar problem, are the following true?
1-You seem to be unable to click on the buttons when you start the game, but if you keep the pointer on the button, second or third click will actually work.
2-While joining a server and a team, single clicks register as double click (so you are not able to look at teams, for example - you automatically try to join as if you had double clicked)
It seems when this happens the first clicks on any control are registered as double-clicks.
Clicks not working in opening screen - double-click in game bug
-
- Posts: 2013
- Joined: Fri Jun 27, 2003 7:00 am
- Location: Contact me regarding: CC, Slayer and AllegWiki.
Last edited by Spunkmeyer on Sun Feb 10, 2013 3:28 am, edited 1 time in total.
Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.
Happened to me a few times but I thought it was because of the mouse (baby smashed it a few times).
- "History repeats itself for a reason" - "It's easy to cry for war when you've never experienced it" - "It's better to negotiate for 10 years then make war for 10 days" - "The strong do as they will, and the weak do as they must"
-
- Posts: 836
- Joined: Sat May 09, 2009 11:00 am
- Location: Germany
I had this happen a few times and every single time it happened after I played another fullscreen game first. Restarting alleg never fixed it - restarting windows always did.
Still ready to teach anyone who asks nicely whatever they want to know about playing alleg. Contrary to popular opinion I do not eat newbies. Voobs taste much better.
Happens to me once in a while, but not too often. Learned to live with it.
EDIT: Alleg always reacts slowly in my comp, and I am a bit impatient with clicks, so I always believed it was a full buffer of some sort. But who knows...
EDIT: Alleg always reacts slowly in my comp, and I am a bit impatient with clicks, so I always believed it was a full buffer of some sort. But who knows...
Last edited by MonAG on Sun Feb 10, 2013 10:07 pm, edited 1 time in total.
-
- Posts: 98
- Joined: Mon Apr 24, 2006 7:00 am
- Location: NZ
I booted up Alleg today for the first time in probably a couple of years, and this issue was bugging the hell out of me.
Enough that I downloaded the source code and took a peek.
Bear in mind my experience with C++ and unmanaged languages is somewhere between minimal and non-existent. Although I do know a thing or two about C# and other managed languages.
So please correct me if I'm getting the wrong idea somewhere.
The problem is that in the click handling code, the IsDoubleClick() function is returning True for a single click. Which is preventing a bunch of single click code from running, and breaking buttons.
Whenever you perform a click, it stores the time this most recent click was made.
Whenever you move the mouse it clears this last click time.
If a second click is performed within 0.25 seconds of the previous click time, then it should count as a double click.
Simple enough.
The Time class stores a DWORD (unsigned long, which apparently in c++ is the same as an unsigned int? Odd, but whatever). Which can range from 0 to 4,294,967,295.
We assign the current time using the WINAPI timeGetTime() function, which returns the number of milliseconds since windows was started. Apparently wrapping back around to 0 when it goes past the limit (which takes just under 50 days). In my case it's currently around 2,229,916,287 (it seems that the hybrid shutdown used on modern windows machines doesn't reset it).
Maybe this means something time related breaks once every 50 days, but that's not a huge problem.
Now in the Time class we also have a bunch of overloaded operators for comparing different times together. Here's the one for checking whether your time is greater than another time.
That's subtracting an unsigned int from an unsigned int, then casting it to a signed int.
If the result of the subtraction is greater than 2,147,483,647 then it's going to result in a negative number.
This means that if windows was last started more than 25 days ago, every click is a double click (unless you very carefully do not move the mouse between mouse down and mouse up). Whoops .
Enough that I downloaded the source code and took a peek.
Bear in mind my experience with C++ and unmanaged languages is somewhere between minimal and non-existent. Although I do know a thing or two about C# and other managed languages.
So please correct me if I'm getting the wrong idea somewhere.
The problem is that in the click handling code, the IsDoubleClick() function is returning True for a single click. Which is preventing a bunch of single click code from running, and breaking buttons.
Whenever you perform a click, it stores the time this most recent click was made.
Whenever you move the mouse it clears this last click time.
If a second click is performed within 0.25 seconds of the previous click time, then it should count as a double click.
Simple enough.
The Time class stores a DWORD (unsigned long, which apparently in c++ is the same as an unsigned int? Odd, but whatever). Which can range from 0 to 4,294,967,295.
We assign the current time using the WINAPI timeGetTime() function, which returns the number of milliseconds since windows was started. Apparently wrapping back around to 0 when it goes past the limit (which takes just under 50 days). In my case it's currently around 2,229,916,287 (it seems that the hybrid shutdown used on modern windows machines doesn't reset it).
Maybe this means something time related breaks once every 50 days, but that's not a huge problem.
Now in the Time class we also have a bunch of overloaded operators for comparing different times together. Here's the one for checking whether your time is greater than another time.
Code: Select all
inline bool operator > (const Time t) const
{
return ((int)(m_dwTime - t.m_dwTime) > 0);
}
If the result of the subtraction is greater than 2,147,483,647 then it's going to result in a negative number.
This means that if windows was last started more than 25 days ago, every click is a double click (unless you very carefully do not move the mouse between mouse down and mouse up). Whoops .
Last edited by Arson_Fire on Mon Feb 06, 2017 2:54 am, edited 1 time in total.
very nice find. I ran into this problem yesterday while developing some changes and it drove me crazy. Thx for this post it will save me some precious time
Indeed my PC just reached the critical number of days yesterday and the 'click' issue happened.
I'll try to find a fix that is not messing with the rest of the game.
Indeed my PC just reached the critical number of days yesterday and the 'click' issue happened.
I'll try to find a fix that is not messing with the rest of the game.