mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-215: Separate LatinNonAlphaNumKeycodes option
(cherry picked from commitcaf366f6f3) (cherry picked from commited143f6d73)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user