stubborn mouse?
Peter Scheele (2290) 178 posts |
Hi, In a program I’m writing this occurs: DEF PROCmouse(x%,y%,button%,window%,icon%) DEF PROCbutton When I run the program and click button 19, PROCmouse is visited twice, corrupting the data, but button 19 is inverted. When I leave the call PROCbutton out, the data stays OK, but button 19 is not inverted. What am I doing wrong? Peter |
Martin Avison (27) 1494 posts |
What do you mean by this?
Means that switch% will always be 1. |
Jan-Jaap van der Geer (123) 63 posts |
I think you forgot to check what button% is. There’s probably two codes coming in, a click and a release or something like that. |
Jeff Doggett (257) 234 posts |
You haven’t said what button type you’ve used for icon 19. |
Peter Scheele (2290) 178 posts |
@Martin: I have a list of names and via internet I find another (which isn’t hard, haha). I want to add it to the top of the list. All the other items have to move down and they do. The corruption is that the new item comes on the second place and the last item on top. At another place in the program addbutton%=TRUE and PROCbutton is called, to switch the button on. I need a 0 or a 1 in PROCbutton and addbutton%+1 makes a 1 from 0 and a 0 from -1. It’s a bit compact. Reporter is pro!, thank you for that:-) @Jan-Jaap and Jeff: it’s Click/Drag, but it should be Click only (a result of nonselective selection). I changed it and… you’re right. It gives one click now and PROCmouse is entered once. I suppose the second came from the drag. Problem solved, Martin, Jan-Jaap and Jeff, thank you very much. |
Jan-Jaap van der Geer (123) 63 posts |
Can’t remember offhand, but shouldn’t you be checking for the button% anyway? I think your button will now also work if you press Menu over it, which is a bit weird. (And it will work for Adjust, but that’s probably OK anyway) I could be wrong though… |
Peter Scheele (2290) 178 posts |
You’re not, Jan-Jaap, it is still on my worklist in the catagory loose ends. But if I knew that it caused this problem, I would have done it in the first place. I understand now why this happened. Thanks! |