Notify of click and release on an icon?
Andrew Conroy (370) 740 posts |
I posted this on the newsgroups, but in case people don’t read them, I’m posting here too. Is there any way to be notified when a user has both clicked on, and then released an icon? It’s possible to set the button type to be notified of a click (button type 3), or to be notified of a release (button type 4), but it doesn’t seem possible to be notified of both. The auto-repeat button type (2) isn’t helpful here, as it’s not possible to tell (from the notification) if the button is being held down, or repeatedly clicked. Effectively it’s a combination of button types 3 & 4 I’m looking for. I’ve currently implemented it by setting the button type to ‘Click’ and then checking the mouse on null polls (Wimp_GetPointerInfo) after a click, to see when the mouse button is released, but I wondered if there’s an easier/more obvious way that I’ve missed? I’m doing this in BASIC. |
Stephen Unwin (1516) 154 posts |
I had a similar issue. I had a grid of icons where I wished one to be selected and held, while dragged to one or more icons and update accordingly. I think I used button type 1 for continuous update and then something like 2840 : DEFPROCgetmouseinfo |
Andrew Conroy (370) 740 posts |
Thanks. I used button type 3, looked for a click and then watched the mouse buttons to see when it was released. I could have done it similar to your way too, I guess. I wonder if there’s scope for a “Notify of click (x1), release (x16)” or similar button type to be added. I note there are two “Reserved” button types, 12 & 13. Could one of those be used? |
nemo (145) 2546 posts |
Isn’t it easiest to start an invisible drag on the click and then you’ll get a drag message when the pointer is released? |
Andrew Conroy (370) 740 posts |
Wouldn’t that rely on the button being held down for longer than the configured WimpDragDelay in order to initiate a drag? |