PS please wrap code in
Code: Select all
tags
Code: Select all
tags
It's possibly a mistake,I'll have to look into it.(more below)Ulf wrote:.......
I'm quite confused about the KeysOld and KeysOld2. I don't get the point of it.
What is the purpose of using bits in this case?
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.
I don't understand the delay. Why return the char when dt==1 and when dt>delay? (code below). Seems strange!
When not using bits, what is all this KeysOld and KeysOld2? Why have 3 versions?
......it would be nicer if it was more readable with constants and defines......
Thanks,I guess it's time to do some revising, so please keep posting any other issues you see.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..
Sorry, I'm not emailing it out.Maybe someone else can.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
If you do this: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++;
Code: Select all
if(em->getMouseMultiClick()==3)
tplclkcnt++;
Thanks for taking me into consideration.KH wrote:On the suggestion of "Ulf" I have changed the key and mse click() functions.
Ok. Haven't looked into that yet. Can't you get left and right ALT and SHIFT without customizing Irrlicht?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.
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;
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
}
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;
}
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;