IrrEventManager v1.8.4 FINAL!

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Re: questions

Post by kh_ »

Edit: It's too late to answer your questions right now, but I'll take a closer look asap.
PS please wrap code in

Code: Select all

tags
its a lot easier to read.
Ulf
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia

Post by Ulf »

Thank you.

I'm quite confused about the KeysOld and KeysOld2. I don't get the point of it.
I can hear birds chirping
:twisted:

I live in the Eye of Insanity.
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

Ulf wrote:.......
I'm quite confused about the KeysOld and KeysOld2. I don't get the point of it.
It's possibly a mistake,I'll have to look into it.(more below)

What is the purpose of using bits in this case?

The reason I chose to use bits was to conserve memory for the arrays.If I had only used 2, I probably wouldn't have bothered with it.



I don't understand the delay. Why return the char when dt==1 and when dt>delay? (code below). Seems strange!
IIRC it was to get demo1 to do what I wanted it to do. I pretty much added dt as a convenience and for the demo. I think the idea was to print the char once then wait for the delay to end before repeating.When your typing a reply,hold down a key and count how long it takes to repeat.


When not using bits, what is all this KeysOld and KeysOld2? Why have 3 versions?

Using bits lets you have the 3 arrays in the space/memory of 1.
The purpose of old 2 and 3 are for getting one-time-only key down events.In other words,when you press a key down, you get one event(for a game I prefer when it happens, not when it is let up again).Without the 3rd, I could only get true once per event.In other words,when calling keyClicked(KEY_KEY_A) more than once, you'd get true only once until let up again and then down again.
Now that you've brought it up, I can see it's more bother than it's worth. My previous engine was like that and it always annoyed me having to test a variable,so I added it. I'll probably remove it in the next release.thanks.

Also at that time I was trying to avoid an update() call at the end of every loop. So it might be possible to remove a lot of garbage there. I was getting burned-out about that point and since it did what I needed I decided to live with it

......it would be nicer if it was more readable with constants and defines......

it might be nicer but would take more of my precious time for something I have no use for.I'll consider it.
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..
Thanks,I guess it's time to do some revising, so please keep posting any other issues you see.
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

Just uploaded a new verson for Irrlicht 1.6
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

there was a small bug in the new release, it was printing out some debug data in release mode. I also changed the codeblocks global irr16 variable to just irr now.
A fixed version is up now. Sorry for any inconvenience.
netpipe
Posts: 670
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Post by netpipe »

Line 18 -> _IRREVENTMANAGER_API irr::IEventManager* _IRREVENTMANAGER_CALLCONV createEventManager()

irrEventManager1.6/irrEventManager1.6_src/CEventManager.cpp|18|error: expected constructor, destructor, or type conversion before ‘(’ token|
||=== Build finished: 1 errors, 0 warnings ===|
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

Thanks for reporting the problem.
All projects build with CodeBlocks/Mingw for me without even a warning .

generally my experience with that error is that a header file isn't being found. I would check the build options to make sure its finding the include folder.

[Edit: this is the only thing I can see a.t.m. that might be the problem]
Then try changing in CEventManager.h and IEventManager.h :

#include "eventmancfg.h" (commented in CEventManager.h)
to
#include "eventman/eventmancfg.h"

Also, if your not using my codeblocks projects you need to define:
EVENTMANAGER_BUILD_DLL

in your compilers build options or in the eventmancfg.h file.
Last edited by kh_ on Sat Oct 31, 2009 10:44 pm, edited 1 time in total.
Faule Socke
Posts: 8
Joined: Sun Feb 15, 2009 9:43 pm

Post by Faule Socke »

Hi,

I have often problems with downloading from RapidShare (for example like now there are no free client slots). If you send me your project via mail (send pm please) I can put it on my webspace (better download speed).

Socke
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

Faule Socke wrote:Hi,

I have often problems with downloading from RapidShare (for example like now there are no free client slots). If you send me your project via mail (send pm please) I can put it on my webspace (better download speed).

Socke
Sorry, I'm not emailing it out.Maybe someone else can.
I just tried RapidShare, no waiting, no problem.It could be your browser settings. Keep trying. Feel free to mirror version1.6(zlib).
Faule Socke
Posts: 8
Joined: Sun Feb 15, 2009 9:43 pm

Post by Faule Socke »

Can someone else send it to me or upload it somewhere else? Rapidshare always says something like "No free client slots"...

Socke
Ulf
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia

Post by Ulf »

@KH

Nice work. I haven't used it yet, but it looks great.
Your test files seem quite thorough.

I didn't understand what you meant in your test1 main file.
KH wrote: ///before a triple click there is always a double click event
///so I'm not sure how to just get the triple without a timer.
///Personally I think it's a waste of space.
///The double-click is nice though
if(em->getMouseMultiClick()==2)
dblclkcnt++;
If you do this:

Code: Select all

if(em->getMouseMultiClick()==3)
    tplclkcnt++;
won't you get what you want?

Are you just counting how many double and triple clicks occur in total?
KH wrote:On the suggestion of "Ulf" I have changed the key and mse click() functions.
Thanks for taking me into consideration.
KH wrote: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.
Ok. Haven't looked into that yet. Can't you get left and right ALT and SHIFT without customizing Irrlicht?
I can hear birds chirping
:twisted:

I live in the Eye of Insanity.
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

Thanks for pointing out that MouseMultiClick problem Ulf.

I went ahead and fixed it. The problem was that the multiClick variable was zeroed when the function was called.

Yes you can now get r/l shift without modding it but afaik not alt.


anyhow,not sure when I'll get around to updating so heres the code:

for IEventManager.h
(remove the old function)

Code: Select all

        //!returns true if L mouse is clicked twice.
        virtual   bool getMouseDoubleClick()=0;

        //!returns true if L mouse is clicked three times.
        virtual   bool getMouseTripleClick()=0;
in CEventManager.cpp :

(in CEventManager.h and CEventManager.cpp remove references to the multiClick variable)

in bool CEventManager::OnEvent(const irr::SEvent& event)
change this part

Code: Select all

else
  if (event.MouseInput.Event == EMIE_MOUSE_DOUBLE_CLICK)
     {
         ///using the 4th bit for double and 5th for triple
           mouseKeys[EMB_L] |= 1<<4;  ///double set to true         

      }
      else
           if (event.MouseInput.Event == EMIE_MOUSE_TRIPLE_CLICK)
             {
                mouseKeys[EMB_L] |= 1<<5;  ///triple set to true 
             }
then add these:

Code: Select all

 bool CEventManager::getMouseDoubleClick()
    {
       s32 out = mouseKeys[EMB_L] & 1<<4;
       mouseKeys[EMB_L] &= ~(1<<4);///set to 0
       return out;

    }

   //!returns true if L mouse is clicked three times.
    bool CEventManager::getMouseTripleClick()
    {
       s32 out = mouseKeys[EMB_L] & 1<<5;
       mouseKeys[EMB_L] &= ~(1<<5);///set to 0
       return out;
    }


in the test

Code: Select all


   ///new getMouseMultiClick();
            static s32 dblclkcnt=0;
            static s32 tripclkcnt=0;


            ///
            if(em->getMouseDoubleClick())
                 dblclkcnt++;

            swprintf(message,256,L"double clicks: %i ",dblclkcnt);
            font->draw(message,rec,fontColor);
            fontY += fontSpace;


            if(em->getMouseTripleClick())
                 tripclkcnt++;

            swprintf(message,256,L"triple clicks: %i ",tripclkcnt);
            font->draw(message,rec,fontColor);
            fontY += fontSpace;

it seems to be working now.
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

I just added a new version for MilkShake who removed his post.
It has the above fix and VC8 lib/projects
milkshakeman
Posts: 27
Joined: Mon Aug 14, 2006 12:36 pm

Post by milkshakeman »

Hi KH,
I removed my post, because I suddenly did see a light at the end of the tunnel, and I can now compile and have everything working in MS VC :D
I can now rightclick and drag in my game to move the cameraview over the map, that was a small milestone in my project completed thanks to irrEventManager.
I can't wait to use it for the GUI.

And thanks for the quick response and the new version uploaded!
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

Great to hear you got it working.Be sure to let me know of any problems.I don't expect all of the GUI elements to work out of the box.I'll be adding them on demand.
Post Reply