< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m

Print this page

        

*** 276,285 **** --- 276,295 ---- java_awt_event_InputEvent_CTRL_DOWN_MASK, java_awt_event_InputEvent_CTRL_MASK, java_awt_event_KeyEvent_VK_CONTROL }, { + NSCommandKeyMask, + //kCGSFlagsMaskAppleLeftCommandKey, + //kCGSFlagsMaskAppleRightCommandKey, + 55, + 54, + java_awt_event_InputEvent_META_DOWN_MASK, + java_awt_event_InputEvent_META_MASK, + java_awt_event_KeyEvent_VK_META + }, + { NSAlternateKeyMask, //kCGSFlagsMaskAppleLeftAlternateKey, //kCGSFlagsMaskAppleRightAlternateKey, 58, 0,
*** 291,311 **** NSAlternateKeyMask, 0, 61, java_awt_event_InputEvent_ALT_DOWN_MASK | java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK, java_awt_event_InputEvent_ALT_MASK | java_awt_event_InputEvent_ALT_GRAPH_MASK, ! java_awt_event_KeyEvent_VK_ALT ! }, ! { ! NSCommandKeyMask, ! //kCGSFlagsMaskAppleLeftCommandKey, ! //kCGSFlagsMaskAppleRightCommandKey, ! 55, ! 54, ! java_awt_event_InputEvent_META_DOWN_MASK, ! java_awt_event_InputEvent_META_MASK, ! java_awt_event_KeyEvent_VK_META }, // NSNumericPadKeyMask { NSHelpKeyMask, 0, --- 301,311 ---- NSAlternateKeyMask, 0, 61, java_awt_event_InputEvent_ALT_DOWN_MASK | java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK, java_awt_event_InputEvent_ALT_MASK | java_awt_event_InputEvent_ALT_GRAPH_MASK, ! java_awt_event_KeyEvent_VK_ALT | java_awt_event_KeyEvent_VK_ALT_GRAPH }, // NSNumericPadKeyMask { NSHelpKeyMask, 0,
*** 317,326 **** --- 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. */
*** 557,571 **** jint javaModifiers = 0; const struct _nsKeyToJavaModifier* cur; for (cur = nsKeyToJavaModifierTable; cur->nsMask != 0; ++cur) { if ((cur->nsMask & nsFlags) != 0) { ! javaModifiers |= isExtMods ? cur->javaExtMask : cur->javaMask; ! if (cur->nsMask == NSAlternateKeyMask && leftAltKeyPressed == NO) { continue; } ! break; } } return javaModifiers; } --- 558,580 ---- 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; }
< prev index next >