Skip to content

Commit 9486355

Browse files
committed
Add check registry method
1 parent 4eba415 commit 9486355

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Linq;
45
using System.Windows.Forms;
56
using CommunityToolkit.Mvvm.Input;
@@ -10,6 +11,8 @@
1011
using Flow.Launcher.Infrastructure.UserSettings;
1112
using Flow.Launcher.Plugin;
1213
using Flow.Launcher.Plugin.SharedModels;
14+
using Microsoft.Win32;
15+
using OpenFileDialog = System.Windows.Forms.OpenFileDialog;
1316

1417
namespace Flow.Launcher.SettingPages.ViewModels;
1518

@@ -25,6 +28,7 @@ public SettingsPaneGeneralViewModel(Settings settings, Updater updater, IPortabl
2528
_updater = updater;
2629
_portable = portable;
2730
UpdateEnumDropdownLocalizations();
31+
IsLegacyKoreanIMEEnabled();
2832
}
2933

3034
public class SearchWindowScreenData : DropdownDataGeneric<SearchWindowScreens> { }
@@ -187,6 +191,48 @@ public string Language
187191
}
188192
}
189193

194+
bool IsLegacyKoreanIMEEnabled()
195+
{
196+
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
197+
const string valueName = "NoTsf3Override5";
198+
199+
try
200+
{
201+
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(subKeyPath))
202+
{
203+
if (key != null)
204+
{
205+
object value = key.GetValue(valueName);
206+
if (value != null)
207+
{
208+
Debug.WriteLine($"[IME DEBUG] '{valueName}' 값: {value} (타입: {value.GetType()})");
209+
210+
if (value is int intValue)
211+
return intValue == 1;
212+
213+
if (int.TryParse(value.ToString(), out int parsed))
214+
return parsed == 1;
215+
}
216+
else
217+
{
218+
Debug.WriteLine($"[IME DEBUG] '{valueName}' 값이 존재하지 않습니다.");
219+
}
220+
}
221+
else
222+
{
223+
Debug.WriteLine($"[IME DEBUG] 레지스트리 키를 찾을 수 없습니다: {subKeyPath}");
224+
}
225+
}
226+
}
227+
catch (Exception ex)
228+
{
229+
Debug.WriteLine($"[IME DEBUG] 예외 발생: {ex.Message}");
230+
}
231+
232+
return false; // 기본적으로 새 IME 사용 중으로 간주
233+
}
234+
235+
190236
public bool ShouldUsePinyin
191237
{
192238
get => Settings.ShouldUsePinyin;

0 commit comments

Comments
 (0)