added isStateKeySet for checking LOCK keys

This commit is contained in:
Brian Matzon 2003-08-19 15:15:00 +00:00
parent caed320677
commit 61305f4107
4 changed files with 45 additions and 1 deletions

View file

@ -397,6 +397,18 @@ public class Keyboard {
assert created : "The keyboard has not been created.";
return keyDownBuffer.get(key) != 0;
}
/**
* Checks whether one of the state keys are "active"
*
* @param key State key to test (KEY_CAPITAL | KEY_NUMLOCK | KEY_SYSRQ)
* @return true if state key is on
*/
public static boolean isStateKeySet(int key) {
assert created : "The keyboard has not been created.";
return nisStateKeySet(key);
}
private static native boolean nisStateKeySet(int key);
/**
* Gets a key's name