IrrEventManager

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

IrrEventManager

Postby kh_ » Sat May 03, 2008 1:54 am

IrrEventManager is a event system to allow using callbacks to handle irrlicht events primarily GUI events.(No need to create your own event receiver).
You can also use traditional function calls like KeyDown() for key and mouse events.

irrEventManager has only been tested on the irrWin32Device.
irrEventManager Does Not require recompiling irrlicht!
Use at your own risk.please report any bugs or ask for help here.

zlib license.


2-4-17
1.84c
With this version, for your own projects,you will probably want to copy the include folder(or just the files) to your irrlicht include folder (then you could include it like this: #include "include\EventManager.h") and the lib file to your compilers irrlicht lib folder to make things easier.

One big change is there is no longer an IEventManager interface, just use CEventManger now.
should have previous bugs fixed
https://drive.google.com/open?id=0BzcAb ... 3JCWjJsYkU


2-3-17
new version ,1 big change,several smaller ones
see the reference file for changes
changed version to 184b

<removed download new version>


2-2-2017
There was a small bug in "EventManager.h" which causes "multiple definition" errors when inlcuding it more than once.
I believe I have a quick fix. It is explained better in the top of the file (below).
You can get the new "EventManager.h" file here. (P.S. it now sets userdata to the receiver by default)

<removed download new version>
Or you could just comment out those 4 functions,they're not mandatory.
I have updated the below package with the new file.
I expect to upload a new version soon ,mainly just adding removeByUserData() back again.

1-31-2017
New Version!!

version 1.84
I see a few people on the forum looking for something like this,so I'm rushing this out now.
Have a long way to go on test #3 (mesh viewer demo) but it seems to be fine on test1 and 2.
Seriously thinking of switching to C#, so this could be the final update.

This has been changed to a static library, You will need to compile it. No more custom bs. Removed a ton of junk code and files.
I have included my CodeBlocks projects (set for 32 bit).These will require a global variable for irrlicht $(#irr).If you don't have one it will ask when you open a project. I also add global include and lib for irrlicht.

I'll try to come up with better documentation over the next few days.


Use at your own risk!
Yesterday I uploaded it with a minor flaw, make sure yours starts with irr.
2-1-17
Just uploaded with docs and another very minor correction (see bottom of docs)
THis is in a zip file now not 7z
<removed download new version>


hope you find it useful, feel free to mirror it.
Make sure you document any changes if you mod it and re-distribute it.



12-15-09
version 16a
added the multiple mouse clicks
added VC8 projects

10-29-09
New version 1.6 for Irrlicht 1.6
some of the changes:

On the suggestion of "Ulf" I have changed the key and mse click() functions.
Now if you call these functions they will only return true 1 time.

Totally reworked test2.

experimental:
added:
IEventManager::mouseMoved();
IEventManager::getMouseMultiClick();

experimental:
With a custom build of irrlicht, it is now possible to get left and right alt key down as well as left and right control and shift.
Last edited by kh_ on Mon Feb 13, 2017 12:19 am, edited 86 times in total.
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby BlindSide » Sat May 03, 2008 2:04 pm

Wow, theres even an Irrlicht Calling Convention, nice. The gui event stuff is definately useful.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby kh_ » Mon May 05, 2008 1:59 am

Thanks, just put a new version up (minor changes). should have an irr1.5 version in a day or 2.
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby MasterGod » Mon May 05, 2008 12:06 pm

BlindSide wrote:Wow, theres even an Irrlicht Calling Convention, nice. The gui event stuff is definately useful.

Why does it needs an Irrlicht calling convention?
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
MasterGod
 
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel

Postby kh_ » Mon May 05, 2008 6:37 pm

MasterGod wrote:Why does it needs an Irrlicht calling convention?


[EDIT] calling convention isn't needed anymore
Last edited by kh_ on Fri Oct 30, 2009 12:29 am, edited 1 time in total.
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby kh_ » Thu Jul 17, 2008 5:47 pm

new version uploaded
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby kh_ » Tue Jan 20, 2009 5:27 pm

new version for irrlicht 1.5 uploaded
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby FuzzYspo0N » Tue Jan 20, 2009 7:28 pm

Hey man, thanks for the effort for the community, this is a great resource
User avatar
FuzzYspo0N
 
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa

Postby kh_ » Wed Jan 21, 2009 12:02 am

Thanks, wish I had more time to work on it.
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby JFT » Wed May 13, 2009 4:07 pm

Hi,
Thanks for your nice Eventmanager.
Is there a function like:
evm->Mousemoved();
or something like that?

Thanks again!

JFT

Sorry for bad english
JFT
 
Posts: 11
Joined: Mon Feb 02, 2009 5:32 pm

Postby kh_ » Thu May 14, 2009 4:02 am

JFT wrote:Is there a function like:
evm->Mousemoved();
or something like that?


Thanks JFT,good idea. I'll try to add it asap. Until then you should be able to add a receiver to the mouse event with evm->getMouseEvent()->addReceiver(yourReceiver)
then test for a mouse_moved event in the receiver.
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby kh_ » Thu May 14, 2009 9:13 pm

OK,I made a quick fix for it. I haven't had time to test it yet,so let me know if there's any problem.
Last edited by kh_ on Thu Feb 02, 2017 1:41 am, edited 1 time in total.
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

Postby Adler1337 » Thu May 14, 2009 10:03 pm

Looks cool, but i believe there is something already like this. Its called MastEventReceiver.
multum in parvo
User avatar
Adler1337
 
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Postby kh_ » Sun Jun 14, 2009 4:08 pm

Adler1337 wrote:Looks cool, but i believe there is something already like this. Its called MastEventReceiver.


F.Y.I. This beast is very different from the Mast Receiver, which I've known about long before you joined this forum.
This is clearly not for you. :roll:
Last edited by kh_ on Wed Jun 17, 2009 2:47 am, edited 1 time in total.
kh_
 
Posts: 75
Joined: Fri May 19, 2006 4:29 pm

questions

Postby Ulf » Tue Jun 16, 2009 4:03 pm

I've just started looking at this code so please forgive me if don't have a broad view.

What is the purpose of using bits in this case?

Is this:
#ifdef _IRREVENTMANAGER_USEBITS
Keys[event.KeyInput.Key] |= 1;

faster than this?:
#endif
chr = event.KeyInput.Char;

I don't see the purpose unless there are many math operations. Not just when you are setting a value. Or am I wrong?

I don't understand the delay. Why return the char when dt==1 and when dt>delay? (code below). Seems strange!

wchar_t CEventManager::keyChar()
{
if (chr)
{
if (dt <= delay)
dt++;
if (dt==1 || dt > delay)
return chr;
}
return 0;
}

//
When not using bits, what is all this KeysOld and KeysOld2? Why have 3 versions? Keeping the last 3 pressed? Or what is going on? (below)

bool CEventManager::keyClick(EKEY_CODE key)
{
if (Keys[key])
{
if (!KeysOld[key])
{
return KeysOld2[key] = KeysOld[key] = true;
}

}
else
KeysOld[key] = false;

return KeysOld2[key];
}

Also, if the using bits does really increase the speed which it doesn't look like it will!, it would be nicer if it was more readable with constants and defines, rather than seeing this:

if (Keys[key] & 1<<0 )//keys[key])
{
if (! ( Keys[key] & (1<<1) ) )//keysOld[key])
{
//Keys[key] |= (1<<2); // 00100
// Keys[key] |= (1<<1); // 00010
Keys[key] |= 0x06;//(3<<1); // 011 == 3
return true;
}

}
else
Keys[key] &= 0x0D ;//~(1<<1);// keysOld[key] = false; ~0010 = 1101 =0x0D

return (Keys[key] & 0x04);//(1<<2)); // = 0100 = 0x04

Regardless, it looks like you have done a lot of work and taken many things into consideration. I hope you keep improving it. I am starting my own event manager for a game engine. I'll post it one of these days..just started using irrlicht..
Ulf
 
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia

Next

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron