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.
1/2019
The pcloud account got deleted,got a new link here.
I haven't used this in a while, I believe this is the final zipped project:
https://my.pcloud.com/publink/show?code ... rXLBbRmHny
LATEST CHANGES:
2-24-2018
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.
changed:
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
make sure you have the latest version
2-20-2018
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.
Bugfix!
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
Code: Select all
fontY += fontSpace; ///replace code after here
stringw stmp(L"GUI last event called...");
stmp+=em->getNameFromLastCalledGuiEvent(); ///returns c8*, seems to work
font->draw(stmp.c_str(),rec,fontColor);
fontY += fontSpace;
stmp = L"GUI last Handled Gui event...";
stmp+=em->getNameFromLastHandledGuiEvent();
font->draw(stmp.c_str(),rec,fontColor);
Code: Select all
static stringw wstring;
static stringc stmp;
stmp = "GUI last event called... ";
stmp += em->getNameFromLastCalledGuiEvent();
core::multibyteToWString(wstring, stmp.c_str());
font->draw(wstring.c_str(),rec,fontColor);
fontY += fontSpace;
stmp = "GUI last Handled Gui event...";
stmp += em->getNameFromLastCalledGuiEvent();
core::multibyteToWString(wstring, stmp.c_str());
font->draw(wstring.c_str(),rec,fontColor);
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.
2-19-2018
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:
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.
2-18-2018
download:
*********************************************************************
LATEST CHANGES:
2-11-2018
New version 1.9
BIG CHANGES!
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.
2-4-17
1.84c
One big change is there is no longer an IEventManager interface, just use CEventManger now.
should have previous bugs fixed
<removed download new version>
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
<removed download new version>
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.
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.