IrrEventManager v1.8.4 FINAL!

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

IrrEventManager v1.8.4 FINAL!

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

IrrEventManager is a event system to allow using callbacks to handle irrlicht events including 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 with OpenGL and DX9.
irrEventManager Now Does require recompiling irrlicht!
Use at your own risk.please report any bugs or ask for help here.

zlib license.


This should be the final release. Next version (if any) will be fully integrated into irrlicht

Renamed to "irrEventManager184_FINAL" since it has been last tested with Irrlcht 1.8.4 now (should still work with SVN)

ADDED visual studio (2012) files.

in IGUIElement.h, changed getReceiverCount() to be more accurate

Remember that you must edit the original IGUIElement.h yourself.(see reference.txt)

these EventManager methods now return wchar_t*

/**get name from type-- for debugging --*/
virtual const wchar_t* getNameFromGuiEventType(gui::EGUI_EVENT_TYPE)=0;

/**get name from last event receiver to return true*/
virtual const wchar_t* getNameFromLastCalledGuiEvent()=0;

/**should return name of eventtype of last called gui receiver that returned true */
virtual const wchar_t* getNameFromLastHandledGuiEvent()=0;

added To IEventManager:

/**get the receiver array so you can add remove etc. yourself*/
virtual core::array<IEventRecEx*>& getReceivers()=0;

changed the examples to use stringw instead of wchar_t[] and swprintf() ect.

see reference.txt for more details.

download ... y3iRaeT6Pk

make sure you have the latest version

This is the latest copy, working with OpenGL. Made a few minor improvements.
version 1.9.2

There is going to be a delay with the visual studio projects.

I got it working in mingw+DX now.
It appears the crashing was due to my bad string handling.
It worked fine in OGL but barfs in DX. I was passing char* to stringw+ .
In example 1, look around line 569 >>> line 579

cpp Code: Select all
          fontY += fontSpace;   ///replace code after here          
          stringw stmp(L"GUI last event called...");
            stmp+=em->getNameFromLastCalledGuiEvent(); ///returns c8*, seems to work
            fontY += fontSpace;
            stmp = L"GUI last Handled Gui event...";

change to

cpp Code: Select all
            static stringw wstring;
            static stringc stmp;
            stmp = "GUI last event called... ";
            stmp += em->getNameFromLastCalledGuiEvent();
            core::multibyteToWString(wstring, stmp.c_str());
            fontY += fontSpace;
            stmp = "GUI last Handled Gui event...";
            stmp += em->getNameFromLastCalledGuiEvent();
            core::multibyteToWString(wstring, stmp.c_str());

As you can see,I guess I should have used core::multibyteToWString(); (not a unicode fan)
In the next release,I'll change the function to return wchar_t*.

You'll have to look at the other tests to see if they have the same bug.
I should have the Visual Studio projects done soon, so I'll upload the fixes then.

Have a small fix.
there was a function added to the EventManager at the last minute.It's not even in the docs.
It should have returned a reference:

core::array<IEventRecEx*>& getReceivers()

this has the 2 files needed to fix it (or you can easily do it yourself).

download: ... VY0SR3Dcv7

The issues I was having appear to be with my IrrlichtDX dll.
Everything is working fine in OpenGl .
I'm uploading the latest just in case.


download: ... C6VHLTbimX

New version 1.9

Returned back to DLL with interfaces.
I finally bit the bullet and intgrated it into the Irrlicht engine.
This removed about %50 of the code.The manager now only stores receivers for non gui events .
All Gui event receivers are stored within the gui element itself.

The only changes are to IGuiElement.h.
I'm including my modified copy of IGuiElement.h in the main folder and explain how to change it in reference.txt.
You will need to recompile Irrlicht now.

Note that I add a 'd' to the end of my Irrlicht Debug dll name >> Irrlichtd.dll

Changed handling of IGUIContextMenu. Manager NO LONGER sets the command id .You must do this in your code, with same command id to both the contextmenu item and the receiver to handle it.See Demo 2.

SEventRecEx has major changes. Constructors are not backward compatible.

I came up with a system to check if the gui is active or not.

Added methods to get last gui event sent and last gui event processed by manager as string and a "guiActive"flag.

Added support for joysticks. This is experimental. I only have 1 joystick to test it with.

(note: there was a problem with missing include folder, fixed now.

P.S. not sure if I gave credit,but the joystick demo is borrowed from the Irrlicht example.


One big change is there is no longer an IEventManager interface, just use CEventManger now.
should have previous bugs fixed
<removed download new version>

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

<removed download new version>


<removed download new version>

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.

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.
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.

version 16a
added the multiple mouse clicks
added VC8 projects

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.


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 Sat Feb 24, 2018 11:23 pm, edited 118 times in total.
Posts: 76
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://
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.
Posts: 76
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?
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
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.
Posts: 76
Joined: Fri May 19, 2006 4:29 pm

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

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

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

new version for irrlicht 1.5 uploaded
Posts: 76
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
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.
Posts: 76
Joined: Fri May 19, 2006 4:29 pm

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

Thanks for your nice Eventmanager.
Is there a function like:
or something like that?

Thanks again!


Sorry for bad english
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:
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.
Posts: 76
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.
Posts: 76
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
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.
Posts: 76
Joined: Fri May 19, 2006 4:29 pm


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:
Keys[event.KeyInput.Key] |= 1;

faster than this?:
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)
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;

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;

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..
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia


Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest