keyboard input
keyboard input
.......
OnEvent function:
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.Key == irr::KEY_LSHIFT &&
event.KeyInput.PressedDown == false)
{
std::cout << "KEY_LSHIFT pressed" << std::endl;
return true;
}
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.Key == irr::KEY_RSHIFT &&
event.KeyInput.PressedDown == false)
{
std::cout << "KEY_RSHIFT pressed" << std::endl;
return true;
}
.........
there is no output in console(same for KEY_LCONTROL & KEY_RCONTROL).
KEY_SHIFT & KEY_CONTROL work but if you press either of them(left or right shift/control).
What i am doing wrong?How do you use these separated?
OnEvent function:
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.Key == irr::KEY_LSHIFT &&
event.KeyInput.PressedDown == false)
{
std::cout << "KEY_LSHIFT pressed" << std::endl;
return true;
}
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.Key == irr::KEY_RSHIFT &&
event.KeyInput.PressedDown == false)
{
std::cout << "KEY_RSHIFT pressed" << std::endl;
return true;
}
.........
there is no output in console(same for KEY_LCONTROL & KEY_RCONTROL).
KEY_SHIFT & KEY_CONTROL work but if you press either of them(left or right shift/control).
What i am doing wrong?How do you use these separated?
-
FriendlyWarlord
- Posts: 58
- Joined: Thu Apr 06, 2006 11:54 pm
Sorry, I don't have a solution... but I had the same "problem", so I believe you are not doing anything wrong. Maybe it depends on what kind of keyboard you have? I'd like clarification on this too...
What I'm more concerned about is some buttons that are missing: ~ [ ] \ ; ' and /
Although, I haven't yet taken the time to actually look into why those are missing, and how to go about adding them in. Sorry, I'm kinda useless here =/
What I'm more concerned about is some buttons that are missing: ~ [ ] \ ; ' and /
Although, I haven't yet taken the time to actually look into why those are missing, and how to go about adding them in. Sorry, I'm kinda useless here =/
=D
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Input in Irrlicht is (IMO) only suitable for demo purposes at the moment. Remember: Irrlicht is a 3d engine, not a game engine. If you're not minded to investigate and fix it yourself, then I'd suggest switching to something like SDL instead.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Why are you get upset?.Why it can be used for game?
Yes i was looked into the source to find something that i could fix about
my problem and i didnt find nothing logical that i could fix, so i am
posting in beginners forum (that is the purpose of this forum i gues).
I am not forcing noone to answer.
You take me like some kid who wants everything on the plate ready.
I am not some rich guy who can buy everything and learn the easy way.
I lose my parents since i was 20 and till now all stuff i do i do by my self!!!
So dont hate me for without good reason.
Sorry for my bad english.
Yes i was looked into the source to find something that i could fix about
my problem and i didnt find nothing logical that i could fix, so i am
posting in beginners forum (that is the purpose of this forum i gues).
I am not forcing noone to answer.
You take me like some kid who wants everything on the plate ready.
I am not some rich guy who can buy everything and learn the easy way.
I lose my parents since i was 20 and till now all stuff i do i do by my self!!!
So dont hate me for without good reason.
Sorry for my bad english.
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
You may be projecting somewhere. I'm not even remotely upset. Here's what's happening:
1) I'm confirming your analysis that there are problems with Irrlicht input.
2) I'm saying that it needs fixed (if you want to use it in a real application), and suggesting that you could do so if you wanted to.
3) If you don't want to (and nobody is asking you to), then I'm suggesting an alternative method that might save you time.
That's it. That's all that's being said.
1) I'm confirming your analysis that there are problems with Irrlicht input.
2) I'm saying that it needs fixed (if you want to use it in a real application), and suggesting that you could do so if you wanted to.
3) If you don't want to (and nobody is asking you to), then I'm suggesting an alternative method that might save you time.
That's it. That's all that's being said.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Is this safe? Is this irrlicht?
Hi,
Is the solution found here safe? Is it STL or Irrlicht? Will it break the cross platform-ness?
Thanks,
-sevans
Is the solution found here safe? Is it STL or Irrlicht? Will it break the cross platform-ness?
Thanks,
-sevans
I would use
to make sure the key is pressed at this exact moment.
The GetAsyncKeyState function is part of the Win32 SDK, not available in *nix.
Code: Select all
if (GetAsyncKeyState(VK_LSHIFT)<0) ...The GetAsyncKeyState function is part of the Win32 SDK, not available in *nix.
-
olivehehe_03
- Posts: 157
- Joined: Tue Mar 20, 2007 8:30 am