Path: news.cs.au.dk!not-for-mail From: Michael Christensen Newsgroups: comp.lang.beta Subject: Re: Right Mouse-click? Date: Mon, 19 Oct 1998 11:48:35 +0200 Organization: Devise, DAIMI, Aarhus University Lines: 80 Message-ID: <362B0AF3.DDFAD21F@daimi.aau.dk> References: <7055u7$254$1@sun579.rz.ruhr-uni-bochum.de> NNTP-Posting-Host: labatt.cs.au.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: xinwen.daimi.aau.dk 908790670 10874 255.255.255.255 (19 Oct 1998 09:51:10 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 19 Oct 1998 09:51:10 GMT X-Mailer: Mozilla 4.06 [en] (WinNT; I) Xref: news.cs.au.dk comp.lang.beta:11729 Sascha Kimmel wrote: > > Hello everyone! > > How can I find out if the user has clicked the right mouse button? > I guess that it's not implemented in BETA because of compatibility with the > Macintosh. > Please tell me if it's possible and if, how. > The code does not need to run under any other OS than MS Windows, so a > little workaround in the ntiprivate-libs would not be very bad for me, but > please tell me how :-) > > Thanx for your help! > > Kind regards, > Sascha Kimmel Íf you, in a window or windowItem (which could be a button, canvas or ...) further bind the eventHandler's "mouseUp" og "mouseDown" event and here test for "buttonState=3", this should evaluate to "true" when the right mouse button was pressed. Below I have pasted in the relevant code from guienv: interfaceObject: (* superpattern for all objects used for interaction with the * user *) (# ... eventhandler:< (* Encapsulates the patterns related to event handling *) (# ... basicEvent: event (* abstract superpattern for all events * originating directly from the OS *) (# ... buttonState: integerValue (* the number designating the button, which was * pressed down, when THIS(basicEvent) occurred * - 0 means 'no button'. This value depe nds * on the number of buttons on the mouse - * Typically 1, 2 or 3. *) ...; ... #); mouseEvent: basicEvent (* abstract superpattern for events related to the * mouse *) ...; ... mouseDown: mouseEvent (* This event occurs when the user presses any mouse * button down on THIS(interfaceObject) *) ...; onMouseDown:< mouseDown; mouseUp: mouseEvent (* This event occurs when the user releases any * mouse button after having pressed it on * THIS(interfaceObject) *)...; onMouseUp:< mouseUp; ... #); ... #) -- Michael _____________________________________________________________________ Michael Christensen Phone: (+45) 89 42 31 88 Computer Science Department, Direct: (+45) 89 42 56 05 Aarhus University Fax: (+45) 89 42 32 55 Åbogade 34, Email: toby@daimi.aau.dk DK-8200 Aarhus N, Denmark www: http://www.daimi.aau.dk/~toby/ _____________________________________________________________________