so me again.
now i think i found a bug.
when i click the mouse Event.KEYINPUT.CHAR is " Char 950 'ζ' wchar_t
"
but Event.keyinput.Key is KEY_KEY_U
and with keyboard pressed on U
char is 'U' and Key is KEY_KEY_U
CLICKING ON MOUSE GENERATES KEYBOARD EVENTS? UPDATED!
CLICKING ON MOUSE GENERATES KEYBOARD EVENTS? UPDATED!
Last edited by Georgian on Fri Jul 13, 2007 2:59 pm, edited 3 times in total.
using Visual Studio 2003 , I use 3D Max 7, I love irrlicht its a really good and easy engine
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
Re: CLICKING ON MOUSE GENERATES KEYBOARD EVENTS? UPDATED!
well can u put the event code first!? as hybird said! i dont understand u really!!Georgian wrote:so me again.
now i think i found a bug.
when i click the mouse Event.KEYINPUT.CHAR is " Char 950 'ζ' wchar_t
"
but Event.keyinput.Key is KEY_KEY_U
and with keyboard pressed on U
char is 'U' and Key is KEY_KEY_U
Re: CLICKING ON MOUSE GENERATES KEYBOARD EVENTS? UPDATED!
Just curious... why are you reading keyboard inputs when testing for mouse events?Georgian wrote:so me again.
now i think i found a bug.
when i click the mouse Event.KEYINPUT.CHAR is " Char 950 'ζ' wchar_t
"
but Event.keyinput.Key is KEY_KEY_U
and with keyboard pressed on U
char is 'U' and Key is KEY_KEY_U
The above sounds like a undefined behavior. I'll have to try this for myself and post my results.
oh the code.. well maybe because its tooo long?
the main.cpp file is well about 4000Lines. and the event receiver part about 1000 lines.
and i test for keys when clicking mouse because I use both mouse and keyboard together.
and well my code is very messed its my first serious project im only 17 and well its the first program in which i have 10000+ lines
and my event receiver is very very crooked i have several GAME MODES (about 10)
and i have like this
if (event.EventType==irr::EET_KEY_INPUT_EVENT||event.EventType==irr::EET_MOUSE_INPUT_EVENT)
{
if(GAMEMODE==PLAY)
{
switch(Event.keyInput.KEY)
{}
switch(event.MouseEvent.Event)
{}
}
//than
if(GAMEMODE==GuessPicture)
{
if(cursorpos.x>12&&cursorpos.x<100&&cursorpos.y>214&&cursorpos.y<555)
{}
}
if(GAMEMODE==WriteWords)
{
if(event.keyInput.KEY==KEY_KEY_X&&WordTowrite[POS]=='X')
{
}
}
}
as i said its my first large program and well my skills arnt too goood
the main.cpp file is well about 4000Lines. and the event receiver part about 1000 lines.
and i test for keys when clicking mouse because I use both mouse and keyboard together.
and well my code is very messed its my first serious project im only 17 and well its the first program in which i have 10000+ lines
and my event receiver is very very crooked i have several GAME MODES (about 10)
and i have like this
if (event.EventType==irr::EET_KEY_INPUT_EVENT||event.EventType==irr::EET_MOUSE_INPUT_EVENT)
{
if(GAMEMODE==PLAY)
{
switch(Event.keyInput.KEY)
{}
switch(event.MouseEvent.Event)
{}
}
//than
if(GAMEMODE==GuessPicture)
{
if(cursorpos.x>12&&cursorpos.x<100&&cursorpos.y>214&&cursorpos.y<555)
{}
}
if(GAMEMODE==WriteWords)
{
if(event.keyInput.KEY==KEY_KEY_X&&WordTowrite[POS]=='X')
{
}
}
}
as i said its my first large program and well my skills arnt too goood
using Visual Studio 2003 , I use 3D Max 7, I love irrlicht its a really good and easy engine
If event.EventType is not EET_KEY_INPUT_EVENT, you should not access any member of event.KeyInput. The reason is that the SEvent structure is implemented as a union. The event.KeyInput data is stored in the same location as the event.MouseInput data.when i click the mouse Event.KEYINPUT.CHAR is " Char 950
Travis
If you have 1000 lines of code in your event receiver, you might want to split it up just a little. It looks like you have a primitive game state system already. You might want to split each state out into its own functions or classes. The overall number of lines will obviously increase, but it will reduce the complexity of the code significantly.
There was discussion of a state system a while back that you might want to take a look at. You can find it here.
Travis
There was discussion of a state system a while back that you might want to take a look at. You can find it here.
Travis