Wrecked Games
September 10, 2010, 09:36:44 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: We're just that awesome.
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: OIS interfering with desktop events  (Read 321 times)
ArmchairArmada
Newbie
*
Posts: 2


View Profile
« on: May 07, 2010, 01:54:14 PM »

Before implementing OIS for unbuffered keyboard input my desktop events worked correctly, but after adding OIS to my project some desktop input events don't behave properly.

Things that do not work while running my application:
* Moving windows
* Resizing windows
* Typing text
* Opening Menu bar items

Things that still work:
* Focusing on windows
* Closing windows
* Scrolling scrollbars
* Clicking some gui buttons

Things I noticed that do not work even after my application is closed:
* Keyboard doesn't repeat when I hold a button down

After closing my application my desktop returns to normal. What might be causing this interference, and how might it be remedied?

Application: Ogre, OIS
Operating System: Ubuntu 9.10

To be clear here, it interferes with my whole desktop, so I cannot interact properly with other applications while my application is running.
Logged
pjcast
Administrator
Veteran
*****
Posts: 2547



View Profile WWW
« Reply #1 on: May 08, 2010, 07:14:18 PM »

If your app has focus, yes the mouse/keyboard will be captured. You can release the mouse with alt-tab. Or, you can turn off mouse capturing in OIS. Besides that, OIS does nothing to your X Window Session.

As for auto repeat, you can disable OIS's turning that off. However, if you shutdown OIS correctly, it will restore that setting when closing.
Logged
ArmchairArmada
Newbie
*
Posts: 2


View Profile
« Reply #2 on: May 08, 2010, 08:23:30 PM »

You seemed to have misunderstood.  When my app does not have focus it interferes with my desktop and other applications.  Why should I not be able to click open menu items in other windows or type into text fields on other applications when those applications do have focus?

I was thinking about it a little more.  Is there something special that has to be done to check if an Ogre window has lost focus and then, perhaps, deactivate OIS?  Then, later, when the window regains focus OIS can be reactivated?

Also, at the moment I am only capturing Keyboard input.  My mouse is free to roam wherever I wish it.  The only OIS object I created was for the keyboard.  I understand what you are saying.  You claim that this is simply ordinary mouse/keyboard capturing, but I know how that is suppose to behave.  What I am experiencing allows me to interact with other windows in some ways but not in others.  If you read the original post you will see what works and what doesn't.  Thanks.
Logged
kornerr
Newbie
*
Posts: 11


View Profile
« Reply #3 on: May 17, 2010, 04:23:08 AM »

Please tell me how to disable OIS touching key autorepeat?
Logged
Nimos
Newbie
*
Posts: 6


View Profile
« Reply #4 on: May 17, 2010, 12:20:25 PM »

ArmchairArmada
Just a guess, but could you be running in input-exclusive mode?
I'm using Ubuntu and the actions you mention works for me when I'm in non-exclusive mode.

See the "Non-exclusive input" part on this page for how to disable exclusive mode.
http://www.ogre3d.org/wiki/index.php/Using_OIS

kornerr
Using
paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("false")));
in the param list (mentioned on the same page) works for me in linux.
Not sure how it is done in Windows though. Undecided
Logged
kornerr
Newbie
*
Posts: 11


View Profile
« Reply #5 on: May 17, 2010, 08:17:16 PM »

This IS touching, because you DO set the repeat value. I want OIS not touch it at all.
Logged
Nimos
Newbie
*
Posts: 6


View Profile
« Reply #6 on: May 18, 2010, 02:29:14 AM »

Okay, misunderstood your question.
From what I can see in the code, passing true for XAutoRepeatOn will result in OIS not touching the X key repeat.
paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
Logged
kornerr
Newbie
*
Posts: 11


View Profile
« Reply #7 on: May 18, 2010, 06:51:58 AM »

Won't it set the autorepeat on if it's off in the system?
Logged
Nimos
Newbie
*
Posts: 6


View Profile
« Reply #8 on: May 18, 2010, 11:46:04 AM »

I thought so too. But you can look in LinuxKeyboard.cpp. I can only find one XAutoRepeatOn and that one is called in the destructor if auto repeat had previously been disabled.
Perhaps pjcast can confirm it, but I guess one should interpret a true value as OIS using auto repeat if it is on, in other words leaving it up to the system.
Logged
kornerr
Newbie
*
Posts: 11


View Profile
« Reply #9 on: May 18, 2010, 08:27:11 PM »

You're right. OIS code is weird. I guess I'll have to look to SDL for not screwing the system then.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!