< prev index next >
src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 317,327 ****
// NSFunctionKeyMask
{0, 0, 0, 0, 0, 0}
};
static BOOL leftAltKeyPressed;
- static BOOL altGRPressed = NO;
/*
* Almost all unicode characters just go from NS to Java with no translation.
* For the few exceptions, we handle it here with this small table.
*/
--- 317,326 ----
*** 565,587 ****
jint javaModifiers = 0;
const struct _nsKeyToJavaModifier* cur;
for (cur = nsKeyToJavaModifierTable; cur->nsMask != 0; ++cur) {
if ((cur->nsMask & nsFlags) != 0) {
!
! if (cur->nsMask == NSAlternateKeyMask) {
! if (leftAltKeyPressed == YES) {
! javaModifiers |= isExtMods? cur->javaExtMask : cur->javaMask;
! if (altGRPressed == NO)
! break;
! } else {
! leftAltKeyPressed = YES;
! altGRPressed = YES;
! continue;
! }
! }
javaModifiers |= isExtMods ? cur->javaExtMask : cur->javaMask;
}
}
return javaModifiers;
}
--- 564,580 ----
jint javaModifiers = 0;
const struct _nsKeyToJavaModifier* cur;
for (cur = nsKeyToJavaModifierTable; cur->nsMask != 0; ++cur) {
if ((cur->nsMask & nsFlags) != 0) {
! //This code will consider the mask value for left alt as well as
! //right alt, but that should be ok, since right alt contains left alt
! //mask value.
javaModifiers |= isExtMods ? cur->javaExtMask : cur->javaMask;
+ if (cur->nsMask == NSAlternateKeyMask && leftAltKeyPressed) {
+ break; //since right alt key struct is defined last, break out of the loop }
+ }
}
}
return javaModifiers;
}
< prev index next >