JBR-215: Separate LatinNonAlphaNumKeycodes option

(cherry picked from commit caf366f6f3)
(cherry picked from commit ed143f6d73)
This commit is contained in:
Denis Konoplev
2020-05-22 03:15:38 +03:00
committed by jbrbot
parent a393252e7b
commit b2421fea9a

View File

@@ -3311,12 +3311,12 @@ void AwtComponent::JavaKeyToWindowsKey(UINT javaKey,
return;
}
static BOOL UseNationalLayoutForShortcurs()
static BOOL UseLatinNonAlphaNumKeycodes()
{
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
jclass cls = env->FindClass("sun/awt/event/KeyEventProcessing");
CHECK_NULL_RETURN(cls, TRUE);
jfieldID fieldID = env->GetStaticFieldID(cls, "useNationalLayouts", "Z");
jfieldID fieldID = env->GetStaticFieldID(cls, "useLatinNonAlphaNumKeycodes", "Z");
CHECK_NULL_RETURN(fieldID, TRUE);
return static_cast<BOOL>(env->GetStaticBooleanField(cls, fieldID));
}
@@ -3365,8 +3365,8 @@ UINT AwtComponent::WindowsKeyToJavaKey(UINT windowsKey, UINT modifiers, UINT cha
}
}
static const BOOL USE_US_LAYOUT_FOR_SHORTCUTS = !UseNationalLayoutForShortcurs();
if (USE_US_LAYOUT_FOR_SHORTCUTS) {
static const BOOL USE_LATIN_NON_ALPHA_NUM_KEYCODES = UseLatinNonAlphaNumKeycodes();
if (USE_LATIN_NON_ALPHA_NUM_KEYCODES) {
for (int i = 0; latinNonAlphaNumKeyMapTable[i].windowsKey != 0; i++) {
if (latinNonAlphaNumKeyMapTable[i].windowsKey == windowsKey &&
latinNonAlphaNumKeyMapTable[i].javaKey != java_awt_event_KeyEvent_VK_UNDEFINED) {