< prev index next >
src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java
Print this page
*** 132,141 ****
--- 132,142 ----
int jeventType = KeyEvent.KEY_PRESSED;
int jkeyCode = KeyEvent.VK_UNDEFINED;
int jkeyLocation = KeyEvent.KEY_LOCATION_UNKNOWN;
boolean postsTyped = false;
+ boolean spaceKeyTyped = false;
char testChar = KeyEvent.CHAR_UNDEFINED;
boolean isDeadChar = (chars!= null && chars.length() == 0);
if (isFlagsChangedEvent) {
*** 148,157 ****
--- 149,163 ----
jkeyLocation = out[1];
jeventType = out[2];
} else {
if (chars != null && chars.length() > 0) {
testChar = chars.charAt(0);
+
+ //Check if String chars contains SPACE character.
+ if ("".equals(chars.trim())) {
+ spaceKeyTyped = true;
+ }
}
char testCharIgnoringModifiers = charsIgnoringModifiers != null && charsIgnoringModifiers.length() > 0 ?
charsIgnoringModifiers.charAt(0) : KeyEvent.CHAR_UNDEFINED;
*** 174,184 ****
jkeyLocation = out[1];
jeventType = isNpapiCallback ? NSEvent.npToJavaEventType(eventType) :
NSEvent.nsToJavaEventType(eventType);
}
! char javaChar = NSEvent.nsToJavaChar(testChar, modifierFlags);
// Some keys may generate a KEY_TYPED, but we can't determine
// what that character is. That's likely a bug, but for now we
// just check for CHAR_UNDEFINED.
if (javaChar == KeyEvent.CHAR_UNDEFINED) {
postsTyped = false;
--- 180,190 ----
jkeyLocation = out[1];
jeventType = isNpapiCallback ? NSEvent.npToJavaEventType(eventType) :
NSEvent.nsToJavaEventType(eventType);
}
! char javaChar = NSEvent.nsToJavaChar(testChar, modifierFlags, spaceKeyTyped);
// Some keys may generate a KEY_TYPED, but we can't determine
// what that character is. That's likely a bug, but for now we
// just check for CHAR_UNDEFINED.
if (javaChar == KeyEvent.CHAR_UNDEFINED) {
postsTyped = false;
< prev index next >