Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: [Linux] OIS turns off key repeat if app crashes  (Read 2201 times)

Olex

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 7
    • View Profile
    • http://ox.slug.louisville.edu/~o0lozi01/wiki
[Linux] OIS turns off key repeat if app crashes
« on: May 03, 2006, 09:31:44 AM »

Here is what is going on.

I use KDE, and enable key repeat.
Run my app with OIS, and only when my app crashes by assert, and it turns off key repeat. (this is repeatable)
When app exits fine, this does not occur.

Any ideas what could be causing this? And possible solutions?

This is a minor issue, as assert crashes don't occur often for me, but still...
Logged
roject: URumble 2 using OPAL physics engine
Rumble Framework

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
[Linux] OIS turns off key repeat if app crashes
« Reply #1 on: May 03, 2006, 10:07:23 AM »

I suggest (if it is possible, I have never tried), to register a sig handler, and nicely shutdown from asserts and other random (non exception crashes). As, OIS uses an XWindows method to turn off autogenerated keyrepeats, and upon termination, it turns it back on.

unfortunately, X does not provide a local (current app) only way to turn off this feature. So, the effect is system wide. Not really an issue for release products (as they should rarely crash), but a pain for debugging.

You can add some code with a ifdef OIS_DEBUG (and of course, you have to define that flag) and create the OIS Input Manager with varioous flags below: http://www.wreckedgames.com/wiki/index.php/WreckedLibs:OIS:Manual:Linux

Though, simple fix, run "xset r" from a terminal, and repeats are back on after a crash.
Logged

Kreso

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 42
    • View Profile
[Linux] OIS turns off key repeat if app crashes
« Reply #2 on: March 15, 2007, 03:04:24 AM »

yes, this is a pretty irritating thing. I only recently discovered that OIS was to blame :)

xset r does the trick, but shouldn't you consider another approach? perhaps a init parameter?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
[Linux] OIS turns off key repeat if app crashes
« Reply #3 on: March 15, 2007, 08:02:49 AM »

What do you mean an init parameter? OIS will not do that if you pass in the x11_keyrepeat false (or something to that effect, look in the wiki for how to do that).

Anyway, this is not an OIS problem, but an application problem. All the end user app has to do is simply shutdown OIS cleanly ;) I could install a sigfault handler in OIS, but it doesn't make much sense since OIS is simply a input system, and already handles itself from crashing.
Logged

Kreso

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 42
    • View Profile
[Linux] OIS turns off key repeat if app crashes
« Reply #4 on: March 15, 2007, 04:00:57 PM »

yeah but, often when I debug my app, I shut down the debugger when I'm done, thus not destroying OIS and leaving keyboard repeat off.

I've solved the issue by enabling 'XAutoRepeatOn' which is what I need in fact :)

I'm just saying that maby you should consider a different approach on X11, mostly for developers and confused users who've experienced a crash.

though it weuld probably take too much work to 'bypass' X11 on that.

oh well, I've solved my problem, that's what matters :)
Logged