wait until LMB pressed

Started by Doc on 16-Jun-2014/7:23:56-7:00
Sorry for such a simple request - I have never used REBOL but have a complex programme I am looking at for a friend. I need to wait until the left mouse button has been pressed down and released ANYWHERE before continuing with the rest of the programme. I have looked on countless sites but all seem to need the mouse lick to be on an object. Many thanks Doc
Not knowing what follows the press, but you could make a button the size of the complete screen in R3. Does that qualify as "ANYWHERE", and not an object?
Insert-event-func allows you to detect high-level/system-wide events. http://www.rebol.com/docs/view-face-events.html
Thanks yoffset - a screen size button would cover the very full set of objects on the guy's screen - the guy's programme is over 7000 lines long so I'm trying not compromise anything that he has already done! Thanks minim - I have no knowledge of REBOL - I want the equivalent to // z=0 until (z=1) {onmousedown==true z=1;} // where onmousedown becomes true when the Left-hand mousebutton is pressed - so until the LMB is pressed the programme remains at this point. Your time is appreciated guys Doc
I think then you want something like below. Note that the buttons do not activate until a RIGHT click has happened. R E B O L [] unview/all view/new layout [ button "press me" [print "I was pressed"] rotary "Won't" "Change" "until" "Mouse" "Clicked" ] my-ef: insert-event-func [ if event/type = 'alt-down [print "Activating application" remove-event-func :my-ef] none ;; Throw away all events ] do-events
Thanks Minim, I'll give that a try. Much appreciated.

Reply