IrrEventManager Major changes! patch 2/19/18

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

IrrEventManager Major changes! patch 2/19/18

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 with OpenGL.
irrEventManager Now Does require recompiling irrlicht!
Use at your own risk.please report any bugs or ask for help here.

zlib license.

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:
https://my.pcloud.com/publink/show?code ... 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.

2-18-2018

download:
https://my.pcloud.com/publink/show?code ... C6VHLTbimX




*********************************************************************
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.
Last edited by kh_ on Mon Feb 19, 2018 1:20 pm, edited 107 times in total.
kh_
 
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://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: 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?
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: 76
Joined: Fri May 19, 2006 4:29 pm

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

new version uploaded
kh_
 
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
kh_
 
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
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: 76
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: 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.
kh_
 
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
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: 76
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