Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Mouse Move + Any Key + Mouse Click

Author
Message
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 4th May 2003 16:04
Nothing much, but this will close your program if a mouse button is clicked, or a key is pressed, or if the mouse is moved.
I hear and I forget. I see and I remember. I do and I understand.
Pal
21
Years of Service
User Offline
Joined: 13th Apr 2003
Location:
Posted: 4th May 2003 17:29
cool.Thanks

I am da man! Beware of my LAZER EYES!
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 5th May 2003 02:38
Changed it a bit.

I hear and I forget. I see and I remember. I do and I understand.
Armeggadon
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 5th May 2003 02:49
heh how many times you gonna come up with one of these. oh well. this one i might use over mine it seems to work better. thx

Current Status: learning MORE about dbpro
I consider myself: newb
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 5th May 2003 02:58
Hehe Armeggadon.

Improved it again, thanks to Sonic and Chiwawa for explanations etc.

I hear and I forget. I see and I remember. I do and I understand.
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 5th May 2003 03:30
I think me and Chiwawa have confused you a bit. You don't need my idea AND his idea as they are both different ways of doing same thing. Chiwawas is easiest though, i.e.

or X <> 0 or Y <> 0 or Z <> 0

this caters for whatever direction you move mouse in. My abs thingy was just to point out to you why your code would not work.

A good reason for using the abs thing though is to stop program exiting if you have a sensitive mouse that moves a pixel or two by itself, or you knock the table, then you can do something like:

or abs(X) > 2 or abs(Y) > 2 or abs(Z) > 2

this will mean only if you move mouse more than 2 pixels in any direction.

Gronda, Gronda
Chiwawa
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 5th May 2003 05:45 Edited at: 5th May 2003 05:47
yeah...cause with my method..if you run close to your computer..mouse will move..and stop the..prog..

then sonic's method is..better...in fact not better..but depend.what you want..

you can also use:

if ((X = 0)=0)

or

if (((X <> 0)=0)<>1)

or anything you love



but the best way is in 1 line

Login to post a reply

Server time is: 2024-05-04 04:15:24
Your offset time is: 2024-05-04 04:15:24