mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-14 08:58:46 +00:00
8028617: Dvorak keyboard mapping not honored when ctrl key pressed
Reviewed-by: pchelko, anthony
This commit is contained in:
parent
d674dee4f2
commit
86e0ce97e6
@ -97,7 +97,8 @@ public class CEmbeddedFrame extends EmbeddedFrame {
|
||||
public void handleKeyEvent(int eventType, int modifierFlags, String characters,
|
||||
String charsIgnoringMods, boolean isRepeat, short keyCode,
|
||||
boolean needsKeyTyped) {
|
||||
responder.handleKeyEvent(eventType, modifierFlags, charsIgnoringMods, keyCode, needsKeyTyped, isRepeat);
|
||||
responder.handleKeyEvent(eventType, modifierFlags, characters, charsIgnoringMods,
|
||||
keyCode, needsKeyTyped, isRepeat);
|
||||
}
|
||||
|
||||
public void handleInputEvent(String text) {
|
||||
|
||||
@ -125,7 +125,7 @@ final class CPlatformResponder {
|
||||
/**
|
||||
* Handles key events.
|
||||
*/
|
||||
void handleKeyEvent(int eventType, int modifierFlags, String chars,
|
||||
void handleKeyEvent(int eventType, int modifierFlags, String chars, String charsIgnoringModifiers,
|
||||
short keyCode, boolean needsKeyTyped, boolean needsKeyReleased) {
|
||||
boolean isFlagsChangedEvent =
|
||||
isNpapiCallback ? (eventType == CocoaConstants.NPCocoaEventFlagsChanged) :
|
||||
@ -153,7 +153,10 @@ final class CPlatformResponder {
|
||||
testChar = chars.charAt(0);
|
||||
}
|
||||
|
||||
int[] in = new int[] {testChar, isDeadChar ? 1 : 0, modifierFlags, keyCode};
|
||||
char testCharIgnoringModifiers = charsIgnoringModifiers != null && charsIgnoringModifiers.length() > 0 ?
|
||||
charsIgnoringModifiers.charAt(0) : KeyEvent.CHAR_UNDEFINED;
|
||||
|
||||
int[] in = new int[] {testCharIgnoringModifiers, isDeadChar ? 1 : 0, modifierFlags, keyCode};
|
||||
int[] out = new int[3]; // [jkeyCode, jkeyLocation, deadChar]
|
||||
|
||||
postsTyped = NSEvent.nsToJavaKeyInfo(in, out);
|
||||
|
||||
@ -200,7 +200,7 @@ public class CPlatformView extends CFRetainedResource {
|
||||
}
|
||||
|
||||
private void deliverKeyEvent(NSEvent event) {
|
||||
responder.handleKeyEvent(event.getType(), event.getModifierFlags(),
|
||||
responder.handleKeyEvent(event.getType(), event.getModifierFlags(), event.getCharacters(),
|
||||
event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
|
||||
}
|
||||
|
||||
|
||||
@ -47,13 +47,15 @@ final class NSEvent {
|
||||
|
||||
// Key event information
|
||||
private short keyCode;
|
||||
private String characters;
|
||||
private String charactersIgnoringModifiers;
|
||||
|
||||
// Called from native
|
||||
NSEvent(int type, int modifierFlags, short keyCode, String charactersIgnoringModifiers) {
|
||||
NSEvent(int type, int modifierFlags, short keyCode, String characters, String charactersIgnoringModifiers) {
|
||||
this.type = type;
|
||||
this.modifierFlags = modifierFlags;
|
||||
this.keyCode = keyCode;
|
||||
this.characters = characters;
|
||||
this.charactersIgnoringModifiers = charactersIgnoringModifiers;
|
||||
}
|
||||
|
||||
@ -121,12 +123,16 @@ final class NSEvent {
|
||||
return charactersIgnoringModifiers;
|
||||
}
|
||||
|
||||
String getCharacters() {
|
||||
return characters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NSEvent[" + getType() + " ," + getModifierFlags() + " ,"
|
||||
+ getClickCount() + " ," + getButtonNumber() + " ," + getX() + " ,"
|
||||
+ getY() + " ," + getAbsX() + " ," + getAbsY()+ " ," + getKeyCode() + " ,"
|
||||
+ getCharactersIgnoringModifiers() + "]";
|
||||
+ getCharacters() + " ," + getCharactersIgnoringModifiers() + "]";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -440,17 +440,20 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
JNIEnv *env = [ThreadUtilities getJNIEnv];
|
||||
|
||||
jstring characters = NULL;
|
||||
jstring charactersIgnoringModifiers = NULL;
|
||||
if ([event type] != NSFlagsChanged) {
|
||||
characters = JNFNSToJavaString(env, [event characters]);
|
||||
charactersIgnoringModifiers = JNFNSToJavaString(env, [event charactersIgnoringModifiers]);
|
||||
}
|
||||
|
||||
static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
|
||||
static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;)V");
|
||||
static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;Ljava/lang/String;)V");
|
||||
jobject jEvent = JNFNewObject(env, jctor_NSEvent,
|
||||
[event type],
|
||||
[event modifierFlags],
|
||||
[event keyCode],
|
||||
characters);
|
||||
characters,
|
||||
charactersIgnoringModifiers);
|
||||
CHECK_NULL(jEvent);
|
||||
|
||||
static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user