Ноw can I send from one part of program keyevent

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
b-s-a
Just popping in
Just popping in
Posts: 10
Joined: Wed Nov 30, 2005 16:12
Location: Moscow, Russia
Contact:

Ноw can I send from one part of program keyevent

Postby b-s-a » Mon Dec 05, 2005 09:24

I try to use this command:

Code: Select all

System::getSingleton().injectKeyDown(Ogre::KC_F12)


But my event listener (which successfully listen for keyboard events) do not catch it. Why?

Code: Select all

void Listener::keyPressed(KeyEvent* key) {
   printf("key pressed (%d)\n", key->getKey() );
   if (key->getKey() == KC_F12 )
      mShutdownRequested = true;
   key->consume();
}

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: >w can I send from one part of program keyevent to the

Postby lindquist » Mon Dec 05, 2005 09:34

CEGUI does not fire Ogre keyboard events. It works the other way around. You should inject CEGUI key down Ogre.

Furthermore the value that you must pass to CEGUI is not the same as in Ogre, IIRC there is a ogre->cegui converter snippet on their wiki.

When you get the injection right, it will trigger KeyDown events in CEGUI which you can catch by subscribing event handlers to the Window::EventKeyDown event.

User avatar
b-s-a
Just popping in
Just popping in
Posts: 10
Joined: Wed Nov 30, 2005 16:12
Location: Moscow, Russia
Contact:

Re: How can I send from one part of program keyevent to the

Postby b-s-a » Mon Dec 05, 2005 12:42

Where can I find key codes for CEGUI::System::getSingleton().injectKeyDown?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: How can I send from one part of program keyevent to the

Postby lindquist » Mon Dec 05, 2005 19:25

They're in cegui_mk2/include/CEGUIInputEvent.h


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 12 guests