Mac OS X: Catch exceptions from getLockingKeyState

This commit is contained in:
Elias Naur 2006-06-10 19:46:28 +00:00
parent 15676f6129
commit 6e6bdb1fa0
1 changed files with 7 additions and 2 deletions

View File

@ -428,8 +428,13 @@ final class MacOSXDisplay implements DisplayImplementation {
default:
return Keyboard.STATE_UNKNOWN;
}
boolean state = Toolkit.getDefaultToolkit().getLockingKeyState(awt_key);
return state ? Keyboard.STATE_ON : Keyboard.STATE_OFF;
try {
boolean state = Toolkit.getDefaultToolkit().getLockingKeyState(awt_key);
return state ? Keyboard.STATE_ON : Keyboard.STATE_OFF;
} catch (Exception e) {
LWJGLUtil.log("Failed to query key state: " + e);
return Keyboard.STATE_UNKNOWN;
}
}
/** Native cursor handles */