Since updating from 2.1.1 to 2.1.7 the cmd-clicking functionality of my app doesn't seem to be working anymore - it is just recognised as a standard click now.
I noticed that the last change to the ModifierKeys class was to do with OS X keypresses - any chance you've accidently broken something there?
It's always possible that I've broken something! But CMD modifiers are coming through ok for me, so I'm not sure what you're doing that's different?
Actually the problem doesn't seem to be with the cmd modifier, but with radio group buttons and sending notifications.
Since updating, when I click on a button set to a radio group it calls the buttonClicked() method 3 times - for the 1st and 3rd times the button pointer passed in is from the clicked button, and for the 2nd time the pointer passed in is from the previously selected button. This wasn't happening for me before.
Is this a fix for how you want radio group buttons to work?
Is there anyway to set it so that when the previously selected button is turned off it doesn't send a notification?
You're definitely on the latest code? I'm sure I already fixed that (?)
Yes I'm definitely on the very latest code.
I've created a fresh repo of the very latest code, built a brand new test app using the introjucer, but I'm still getting the 3 buttonClicked() calls issue.
If the issue has definitely been fixed, what could I be doing wrong to get the error?
If you look at the git log for Button, you'll see my struggle with the exact logic inside Button::internalClickCallback. This is now my 4th or 5th attempt at getting the fucking thing right.. It'll probably break some other obscure use-case, but fingers crossed!
Jules, I'm afraid to say that not all issues with radio group buttons have been completely fixed yet...
While the issue I described above has been fixed, I've discovered a new beahviour that's causing problems for me, to do with at what point the internal state of a toggle button is being turned off.
In my app when I click on a radio group button, within my buttonClicked() function I'm checking the toggleState of each of the button in the radio group. Previously when I was on v2.1.1 the toggleState of the previously selected button would be equal to false by the time buttonClicked() was called, but now on the latest code it still seems to equal true. So it seems like the internal state of the previously selected button is set to false after buttonClicked() is called, instead of before as previously.
Thoughts? Was this a change you wanted?
Ok, at the risk on unleashing yet another pandora's-box of edge-case problems from other people, I've now changed it so that for a radio-group, the on->off happens before the off->on.
That should sort out your problem. It'll also mean that anyone who's written code that doesn't bother checking the actual on/off state, and which just treats all button-click events as being "on" will work better, because even if they mistakenly treat both callbacks as being "on", the final state will end up the way they probably expected it.
I suspect that within 5 minutes of posting this the forum will be full of baffled people wondering why their bizarre edge-case code has stopped working..
Thanks Jules, all is working again now. With any luck this will be the end of this issue now!
I'll believe that when I see it!