mouse release

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
VPB
Posts: 36
Joined: Sat Apr 10, 2004 8:02 am

mouse release

Post by VPB »

Is there anyway to detect with your Eventreceiver if a mousebutton is released? Because I couldn't find anything for this.

If anyone has a solution I would like to hear it :lol: :lol: :lol: :lol:
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

Looking into documentation is a nice habit you shoul try it. (c)
http://irrlicht.sourceforge.net/docu/na ... .html#a179
Tomasz Nowakowski
Openoko - www.openoko.pl
Guest

Post by Guest »

EMIE_LMOUSE_LEFT_UP
for example
VPB
Posts: 36
Joined: Sat Apr 10, 2004 8:02 am

Post by VPB »

EMIE_LMOUSE_LEFT_UP means that that button is not pressed. This does not mean that that button was released !!!.

EMIE_LMOUSE_PRESSED_DOWN Left mouse button was pressed down.
EMIE_RMOUSE_PRESSED_DOWN Right mouse button was pressed down.
EMIE_MMOUSE_PRESSED_DOWN Middle mouse button was pressed down.
EMIE_LMOUSE_LEFT_UP Left mouse button was left up.
EMIE_RMOUSE_LEFT_UP Right mouse button was left up.
EMIE_MMOUSE_LEFT_UP Middle mouse button was left up.
EMIE_MOUSE_MOVED The mouse cursor changed its position.
EMIE_MOUSE_WHEEL The mouse wheel was moved.

But no EMIE_LMOUSE_RELEASED or something. so could anyone think of some code to detect if a mousebutton is released.

Thanks in advance 8)
Guest

Post by Guest »

Mouse Button RELEASED = EMIE_LMOUSE_LEFT_UP
Its the next event after you pressed it down.
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

> EMIE_LMOUSE_LEFT_UP means that that button is not pressed. This does
> not mean that that button was released !!!.


So just tell me how can system generate event on not pressing mouse button ? ;)

OK, time to stop joking. Just add following lines before your event reciver so it can detect if a mouse button is released.

Code: Select all

#define EMIE_LMOUSE_RELEASED EMIE_LMOUSE_LEFT_UP
#define EMIE_RMOUSE_RELEASED EMIE_RMOUSE_LEFT_UP
#define EMIE_MMOUSE_RELEASED EMIE_MMOUSE_LEFT_UP
Sorry, but i just couldn't resist ;)
Tomasz Nowakowski
Openoko - www.openoko.pl
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

If you have the two states of pressed down and left up you have the falling edge of pressed down don't you? The rising edge of left up ( which is what both are activated by ) is the falling edge of pressed down as they are the only two possible states. A simple moniter to detect when this rising edge occurs is all that is necessary.
VPB
Posts: 36
Joined: Sat Apr 10, 2004 8:02 am

Post by VPB »

Thanks for all your help :lol:

But i think the documentation should be more clear about this :wink:
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

rising edge and falling edge? Do you work with electronics Tyn? Just curious as I haven't heard that terminlogy elswhere
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Heh, I didn't know those terms were isolated to electrics :) I guess that means you're in the industry as well?

Yeah, I'm a wireman in a machine maker company, I do quite a bit of programming there too due to the lack of staff, which is mostly due to the crappy state of engineering in general. Good fun, a lot of my problems with stuff I want to do in 2080 has oddly enough been solved by having the same problems in work and solving them there, most recently the problem of having a move buffer which I have now solved and put in the latest release.

*** For non sparky's :) ***

Rising and falling edge refers to the creation and decay of an electrical pulse. E.g.

/------\

The creation is the rising edge, when the signal is starting to be sent, the pitch is the length of the pulse and the falling edge is when the pulse stops being sent. To see this effect, click a button in whatever OS you use and try to figure out which edge it's function is being called on. It should be the falling edge :)

By having the mouse button have two states, you have the advantage of being able to detect both edges of the mouse button being pressed. This is a literal pulse from the mouse to the computer which you can moniter through Irrlicht ( which moniter's it from Windows, yada yada yada ).
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

I don't know if the terms are isolated to electronics, I've just never heard them elswwhere. I'm not actually in the industry, I'm a high school student, but electronics is my other hobby, though I've been doing more programming than electronics lately.
Post Reply