brackets keycodes...
brackets keycodes...
Hi
Can someone tell me please what EKEY_CODE
have bracket keys in Irrlicht?
I mean these two brackets: [ and ]
Could't find these two in Irrlicht docs nor in Keycodes.h
thx,
-mike
Can someone tell me please what EKEY_CODE
have bracket keys in Irrlicht?
I mean these two brackets: [ and ]
Could't find these two in Irrlicht docs nor in Keycodes.h
thx,
-mike
there is no key code for them !!!
that's because they are a combination of two keys (Alt + 8 and Alt + 9)...
so check for irr::KEY_MENU && irr::KEY_KEY_8 and irr::KEY_MENU && irr::KEY_KEY_9 !!!
that's because they are a combination of two keys (Alt + 8 and Alt + 9)...
so check for irr::KEY_MENU && irr::KEY_KEY_8 and irr::KEY_MENU && irr::KEY_KEY_9 !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
realy ???
for me it works !!!
I used the event receiver from the movement tutorial though (same as the MastEventReceiver I think):
and in the main loop i do this:
for me it works !!!
I used the event receiver from the movement tutorial though (same as the MastEventReceiver I think):
Code: Select all
class MyEventReceiver : public IEventReceiver{
public:
virtual bool OnEvent(const SEvent& event){
if (event.EventType == irr::EET_KEY_INPUT_EVENT)
KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
return false;
}
virtual bool IsKeyDown(EKEY_CODE keyCode) const{
return KeyIsDown[keyCode];
}
MyEventReceiver(){
for (u32 i=0; i<KEY_KEY_CODES_COUNT; ++i)
KeyIsDown[i] = false;
}
private:
bool KeyIsDown[KEY_KEY_CODES_COUNT];
};
Code: Select all
while(device->run()){
if(receiver.IsKeyDown(irr::KEY_MENU) && receiver.IsKeyDown(irr::KEY_KEY_8)){
printf("pressed [\n");
}else if(receiver.IsKeyDown(irr::KEY_MENU) && receiver.IsKeyDown(irr::KEY_KEY_9)){
printf("pressed ]\n");
}
}
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
nope...
I even did copy & paste it (just to test your code)
into the 04 Movement example (these lines in main-loop from your post)
and it didn't work... (with the original receiver of corse, exactly as above)
Im using standard 101/102 keyboard , (english, QWERTY layout).
all under XP.
As i said, its not SO big problem, but I wanted only to mention this.
-mike
PS. my 'ALT' keys do work
I even did copy & paste it (just to test your code)
into the 04 Movement example (these lines in main-loop from your post)
and it didn't work... (with the original receiver of corse, exactly as above)
Im using standard 101/102 keyboard , (english, QWERTY layout).
all under XP.
As i said, its not SO big problem, but I wanted only to mention this.
-mike
PS. my 'ALT' keys do work
hu, that's strange...mike76 wrote:nope...
I even did copy & paste it (just to test your code)
into the 04 Movement example (these lines in main-loop from your post)
and it didn't work... (with the original receiver of corse, exactly as above)
Im using standard 101/102 keyboard , (english, QWERTY layout).
all under XP.
I'm also using XP with a standard keyboard, but german layout (QWERTZ)...
you can also try it with KEY_RMENU (I'm in doubt for KEY_LMENU though)...
even if you use bitplane's advice or other keys I'm realy curious why it does work for me, but not for you !?!?!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Ok, I put this:
into my Reciever to see what codes (if any) it returns.
and for [ =91 and for ] =93
-their ASCII codes, and its ok.
Of corse still no response for ALT keys ( KEY_MENU / KEY_RMENU / KEY_LMENU )
it this way, and keys like SHIFT/ CONTROL wont work too!
printing their ASCII codes gives their numbers (for CONTROL=17 and SHIFT= 16)
But using like this:
do nothing,
(no matter if: KEY_RSHIFT, KEY_LSHIFT or KEY_LCONTROL , KEY_RCONTROL etc... )
What have I noticed is, that this key: \ + | (its just left side from BACKSPACE) and called "KEY_SEPARATE" (right?) wont work in Irrlicht too here.
What is interesting, its its ASCII code is.... 92 !
It looks like, keys with ASCII codes: 91, 92 and 93 and SHIFT, CONTROL , ALT wont work for me in Irrlicht, all other keys (even so "exotic" like Pause/Break, ScrollLock , function-keys or Numpads...) are working properly.
As I said, forget this, its not very important to me (I can use [ and ] and \ through their ASCII codes , and ALTs... oh well...
-mike
PS.
my system (win XP/SP2) is German one but my keyboard is "interational" (without any national chars, no german chars, no english pound etc.) its standard QWERTY.
Besides Irrlicht was always everything ok. ( im not sure now, but under SDL was it ok too.)
Code: Select all
printf(" key=%d char=%d \n", event.KeyInput.Key, event.KeyInput.Char);
and for [ =91 and for ] =93
-their ASCII codes, and its ok.
Of corse still no response for ALT keys ( KEY_MENU / KEY_RMENU / KEY_LMENU )
it this way, and keys like SHIFT/ CONTROL wont work too!
printing their ASCII codes gives their numbers (for CONTROL=17 and SHIFT= 16)
But using like this:
Code: Select all
if (receiver.IsKeyDown(irr::KEY_SHIFT) )
//................. do something........
do nothing,
(no matter if: KEY_RSHIFT, KEY_LSHIFT or KEY_LCONTROL , KEY_RCONTROL etc... )
What have I noticed is, that this key: \ + | (its just left side from BACKSPACE) and called "KEY_SEPARATE" (right?) wont work in Irrlicht too here.
What is interesting, its its ASCII code is.... 92 !
It looks like, keys with ASCII codes: 91, 92 and 93 and SHIFT, CONTROL , ALT wont work for me in Irrlicht, all other keys (even so "exotic" like Pause/Break, ScrollLock , function-keys or Numpads...) are working properly.
As I said, forget this, its not very important to me (I can use [ and ] and \ through their ASCII codes , and ALTs... oh well...
-mike
PS.
my system (win XP/SP2) is German one but my keyboard is "interational" (without any national chars, no german chars, no english pound etc.) its standard QWERTY.
Besides Irrlicht was always everything ok. ( im not sure now, but under SDL was it ok too.)
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
I added to myreceiver little function which returns the key code directly:
and now I can use like this:
for [ ] and |
Strange anyway, but thanks.
-mike
and now I can use like this:
Code: Select all
if (receiver.returnCode()==221 ........
Strange anyway, but thanks.
-mike