Skip to content

Commit 4309051

Browse files
committed
Added modifier text for lock keys.
1 parent a8e5035 commit 4309051

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/java/org/jnativehook/NativeInputEvent.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,21 @@ public static String getModifiersText(int modifiers) {
271271
param.append('+');
272272
}
273273

274+
if ((modifiers & NativeInputEvent.CAPS_LOCK_MASK) != 0) {
275+
param.append(Toolkit.getProperty("AWT.capsLock", "Caps Lock"));
276+
param.append('+');
277+
}
278+
279+
if ((modifiers & NativeInputEvent.NUM_LOCK_MASK) != 0) {
280+
param.append(Toolkit.getProperty("AWT.numpad_numLock", "Num Lock"));
281+
param.append('+');
282+
}
283+
284+
if ((modifiers & NativeInputEvent.SCROLL_LOCK_MASK) != 0) {
285+
param.append(Toolkit.getProperty("AWT.scrollLock", "Scroll Lock"));
286+
param.append('+');
287+
}
288+
274289
if (param.length() > 0) {
275290
// Remove the trailing '+'.
276291
param.deleteCharAt(param.length() - 1);

0 commit comments

Comments
 (0)