@@ -34,6 +34,7 @@ public SettingsPaneGeneralViewModel(Settings settings, Updater updater, IPortabl
34
34
_portable = portable ;
35
35
_translater = translater ;
36
36
UpdateEnumDropdownLocalizations ( ) ;
37
+ // Initialize the Korean IME status by checking registry
37
38
IsLegacyKoreanIMEEnabled ( ) ;
38
39
OpenImeSettingsCommand = new RelayCommand ( OpenImeSettings ) ;
39
40
}
@@ -188,129 +189,135 @@ public string Language
188
189
UpdateEnumDropdownLocalizations ( ) ;
189
190
}
190
191
}
192
+
193
+ // The new Korean IME used in Windows 11 has compatibility issues with WPF. This issue is difficult to resolve within
194
+ // WPF itself, but it can be avoided by having the user switch to the legacy IME at the system level. Therefore,
195
+ // we provide guidance and a direct button for users to make this change themselves. If the relevant registry key does
196
+ // not exist (i.e., the Korean IME is not installed), this setting will not be shown at all.
197
+ #region Korean IME
191
198
public bool LegacyKoreanIMEEnabled
192
- {
193
- get => IsLegacyKoreanIMEEnabled ( ) ;
194
- set
195
199
{
196
- Debug . WriteLine ( $ "[DEBUG] LegacyKoreanIMEEnabled changed: { value } " ) ;
197
- if ( SetLegacyKoreanIMEEnabled ( value ) )
200
+ get => IsLegacyKoreanIMEEnabled ( ) ;
201
+ set
198
202
{
199
- OnPropertyChanged ( nameof ( LegacyKoreanIMEEnabled ) ) ;
200
- OnPropertyChanged ( nameof ( KoreanIMERegistryValueIsZero ) ) ;
203
+ Debug . WriteLine ( $ "[DEBUG] LegacyKoreanIMEEnabled changed: { value } ") ;
204
+ if ( SetLegacyKoreanIMEEnabled ( value ) )
205
+ {
206
+ OnPropertyChanged ( nameof ( LegacyKoreanIMEEnabled ) ) ;
207
+ OnPropertyChanged ( nameof ( KoreanIMERegistryValueIsZero ) ) ;
208
+ }
209
+ else
210
+ {
211
+ Debug . WriteLine ( "[DEBUG] Failed to set LegacyKoreanIMEEnabled" ) ;
212
+ }
201
213
}
202
- else
214
+ }
215
+
216
+ public bool KoreanIMERegistryKeyExists => IsKoreanIMEExist ( ) ;
217
+
218
+ public bool KoreanIMERegistryValueIsZero
219
+ {
220
+ get
203
221
{
204
- Debug . WriteLine ( "[DEBUG] Failed to set LegacyKoreanIMEEnabled" ) ;
222
+ object value = GetLegacyKoreanIMERegistryValue ( ) ;
223
+ if ( value is int intValue )
224
+ {
225
+ return intValue == 0 ;
226
+ }
227
+ else if ( value != null && int . TryParse ( value . ToString ( ) , out int parsedValue ) )
228
+ {
229
+ return parsedValue == 0 ;
230
+ }
231
+
232
+ return false ;
205
233
}
206
234
}
207
- }
208
235
209
- public bool KoreanIMERegistryKeyExists => IsKoreanIMEExist ( ) ;
236
+ bool IsKoreanIMEExist ( )
237
+ {
238
+ return GetLegacyKoreanIMERegistryValue ( ) != null ;
239
+ }
210
240
211
- public bool KoreanIMERegistryValueIsZero
212
- {
213
- get
241
+ bool IsLegacyKoreanIMEEnabled ( )
214
242
{
215
243
object value = GetLegacyKoreanIMERegistryValue ( ) ;
244
+
216
245
if ( value is int intValue )
217
246
{
218
- return intValue == 0 ;
247
+ return intValue == 1 ;
219
248
}
220
249
else if ( value != null && int . TryParse ( value . ToString ( ) , out int parsedValue ) )
221
250
{
222
- return parsedValue == 0 ;
251
+ return parsedValue == 1 ;
223
252
}
224
253
225
254
return false ;
226
255
}
227
- }
228
-
229
- bool IsKoreanIMEExist ( )
230
- {
231
- return GetLegacyKoreanIMERegistryValue ( ) != null ;
232
- }
233
-
234
- bool IsLegacyKoreanIMEEnabled ( )
235
- {
236
- object value = GetLegacyKoreanIMERegistryValue ( ) ;
237
256
238
- if ( value is int intValue )
239
- {
240
- return intValue == 1 ;
241
- }
242
- else if ( value != null && int . TryParse ( value . ToString ( ) , out int parsedValue ) )
257
+ bool SetLegacyKoreanIMEEnabled ( bool enable )
243
258
{
244
- return parsedValue == 1 ;
245
- }
259
+ const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}" ;
260
+ const string valueName = "NoTsf3Override5" ;
246
261
247
- return false ;
248
- }
249
-
250
- bool SetLegacyKoreanIMEEnabled ( bool enable )
251
- {
252
- const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}" ;
253
- const string valueName = "NoTsf3Override5" ;
254
-
255
- try
256
- {
257
- using ( RegistryKey key = Registry . CurrentUser . CreateSubKey ( subKeyPath ) )
262
+ try
258
263
{
259
- if ( key != null )
264
+ using ( RegistryKey key = Registry . CurrentUser . CreateSubKey ( subKeyPath ) )
260
265
{
261
- int value = enable ? 1 : 0 ;
262
- key . SetValue ( valueName , value , RegistryValueKind . DWord ) ;
263
- return true ;
264
- }
265
- else
266
- {
267
- Debug . WriteLine ( $ "[IME DEBUG] Failed to create or open registry key: { subKeyPath } ") ;
266
+ if ( key != null )
267
+ {
268
+ int value = enable ? 1 : 0 ;
269
+ key . SetValue ( valueName , value , RegistryValueKind . DWord ) ;
270
+ return true ;
271
+ }
272
+ else
273
+ {
274
+ Debug . WriteLine ( $ "[IME DEBUG] Failed to create or open registry key: { subKeyPath } ") ;
275
+ }
268
276
}
269
277
}
270
- }
271
- catch ( Exception ex )
272
- {
273
- Debug . WriteLine ( $ "[IME DEBUG] Exception occurred while setting registry: { ex . Message } ") ;
274
- }
275
-
276
- return false ;
277
- }
278
+ catch ( Exception ex )
279
+ {
280
+ Debug . WriteLine ( $ "[IME DEBUG] Exception occurred while setting registry: { ex . Message } ") ;
281
+ }
278
282
279
- private object GetLegacyKoreanIMERegistryValue ( )
280
- {
281
- const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}" ;
282
- const string valueName = "NoTsf3Override5" ;
283
+ return false ;
284
+ }
283
285
284
- try
286
+ private object GetLegacyKoreanIMERegistryValue ( )
285
287
{
286
- using ( RegistryKey key = Registry . CurrentUser . OpenSubKey ( subKeyPath ) )
288
+ const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}" ;
289
+ const string valueName = "NoTsf3Override5" ;
290
+
291
+ try
287
292
{
288
- if ( key != null )
293
+ using ( RegistryKey key = Registry . CurrentUser . OpenSubKey ( subKeyPath ) )
289
294
{
290
- return key . GetValue ( valueName ) ;
295
+ if ( key != null )
296
+ {
297
+ return key . GetValue ( valueName ) ;
298
+ }
291
299
}
292
300
}
293
- }
294
- catch ( Exception ex )
295
- {
296
- Debug . WriteLine ( $ "[IME DEBUG] Exception occurred: { ex . Message } ") ;
297
- }
298
-
299
- return null ;
300
- }
301
+ catch ( Exception ex )
302
+ {
303
+ Debug . WriteLine ( $ "[IME DEBUG] Exception occurred: { ex . Message } ") ;
304
+ }
301
305
302
- private void OpenImeSettings ( )
303
- {
304
- try
305
- {
306
- Process . Start ( new ProcessStartInfo ( "ms-settings:regionlanguage" ) { UseShellExecute = true } ) ;
306
+ return null ;
307
307
}
308
- catch ( Exception e )
308
+
309
+ private void OpenImeSettings ( )
309
310
{
310
- Debug . WriteLine ( $ "Error opening IME settings: { e . Message } ") ;
311
+ try
312
+ {
313
+ Process . Start ( new ProcessStartInfo ( "ms-settings:regionlanguage" ) { UseShellExecute = true } ) ;
314
+ }
315
+ catch ( Exception e )
316
+ {
317
+ Debug . WriteLine ( $ "Error opening IME settings: { e . Message } ") ;
318
+ }
311
319
}
312
- }
313
-
320
+ #endregion
314
321
315
322
public bool ShouldUsePinyin
316
323
{
0 commit comments