Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: [SOLVED] Instruct OIS not to handle key  (Read 333 times)

zadirion

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
[SOLVED] Instruct OIS not to handle key
« on: May 04, 2011, 08:38:38 PM »

How do I instruct OIS not to handle specific keys, and forward them to the operating system?
Take for example the Ctrl+Shift+Esc key combo, it shows the task manager. However OIS catches the KC_ESCAPE key, and the keypress never gets to the OS, thus no Task Manager is shown.
I most certainly don't want to 'eat' certain keys, I want to let the OS handle them.

How do I go about this, without using microsoft API? (I want to keep it cross-platform)
« Last Edit: May 04, 2011, 09:31:52 PM by zadirion »
Logged

zadirion

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Re: Instruct OIS not to handle key
« Reply #1 on: May 04, 2011, 09:27:51 PM »

Looked through the OIS implementation for windows and figured it out myself.
For anyone else looking for the answer:

At input system creation, apart from the "WINDOW" parameter, need to pass these on too, in the ParamList
Code: [Select]
pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_BACKGROUND" )));
pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));

To the OIS implementers:
Great library guys, I'm using it and I love it!
One small note though: please document the available parameters. Also, the NONEXCLUSIVE mode should perhaps be the default, otherwise the end-user would have a very annoying experience with the resulting application using OIS.

Have a nice day!
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Re: [SOLVED] Instruct OIS not to handle key
« Reply #2 on: May 06, 2011, 06:56:48 PM »

You have to be cautious with those settings, it may make key/text translations break.
Logged