From 9486355102c12e4c99d00b941eda0380ce8e8716 Mon Sep 17 00:00:00 2001 From: DB P Date: Sat, 5 Apr 2025 20:14:31 +0900 Subject: [PATCH] Add check registry method --- .../SettingsPaneGeneralViewModel.cs | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index cec8c318c..a1b38a53c 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Windows.Forms; using CommunityToolkit.Mvvm.Input; @@ -10,6 +11,8 @@ using Flow.Launcher.Helper; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; +using Microsoft.Win32; +using OpenFileDialog = System.Windows.Forms.OpenFileDialog; namespace Flow.Launcher.SettingPages.ViewModels; @@ -25,6 +28,7 @@ public partial class SettingsPaneGeneralViewModel : BaseModel _updater = updater; _portable = portable; UpdateEnumDropdownLocalizations(); + IsLegacyKoreanIMEEnabled(); } public class SearchWindowScreenData : DropdownDataGeneric { } @@ -187,6 +191,48 @@ public partial class SettingsPaneGeneralViewModel : BaseModel } } + bool IsLegacyKoreanIMEEnabled() + { + const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}"; + const string valueName = "NoTsf3Override5"; + + try + { + using (RegistryKey key = Registry.CurrentUser.OpenSubKey(subKeyPath)) + { + if (key != null) + { + object value = key.GetValue(valueName); + if (value != null) + { + Debug.WriteLine($"[IME DEBUG] '{valueName}' 값: {value} (타입: {value.GetType()})"); + + if (value is int intValue) + return intValue == 1; + + if (int.TryParse(value.ToString(), out int parsed)) + return parsed == 1; + } + else + { + Debug.WriteLine($"[IME DEBUG] '{valueName}' 값이 존재하지 않습니다."); + } + } + else + { + Debug.WriteLine($"[IME DEBUG] 레지스트리 키를 찾을 수 없습니다: {subKeyPath}"); + } + } + } + catch (Exception ex) + { + Debug.WriteLine($"[IME DEBUG] 예외 발생: {ex.Message}"); + } + + return false; // 기본적으로 새 IME 사용 중으로 간주 + } + + public bool ShouldUsePinyin { get => Settings.ShouldUsePinyin;