private void EditKey(ClKey key) { this.BtnMain.Text = MdSessionData.CurrentInputMethod.GetDisplay(key.DisplayID); this.Key = key; if (ValueChanged != null) { ValueChanged(this, EventArgs.Empty); } }
private void EditKey(int x, int y, int z, int com, ClKey key) { foreach (var k in MdSessionData.CurrentLayout.KeyDatas) { if ((k.X == x) && (k.Y == y) && (k.Command == com)) { if ((k.Z == z) || key.AllLayers || this.CBAllLayers.Checked.Value) { k.Key = key; } } } MdSessionData.CurrentKeyboardUI.LoadLayout(MdSessionData.CurrentLayout); }
public static List <ClKey> GenereateSubHIDSet(ClKeyGroup kg, int first2Digits, byte keyType, bool overrideAllLayers = false) { var dat = kg.Keys.Where(ele => ele.DisplayID >= 0 && ele.DisplayID < 300).ToList(); var output = new List <ClKey>(); foreach (var ele in dat) { int sid = first2Digits * 100 + ele.DisplayID; var key = new ClKey(ele); key.DisplayID = sid; key.KeyType = keyType; if (overrideAllLayers) { key.AllLayers = overrideAllLayers; } output.Add(key); } return(output); }
public static void Init() { MdConfig.Init(); CurrentKeyboardType = new ClKeyboard(); CurrentLayout = new ClLayoutContainer(); CurrentKeyboardUI = new UCKeyboard(); KeyMenuKey = new ClKey(); CurrentInputMethod = new ClDisplayCharacterContainer(); KeyGroup = new ClKeyGroup(); SP = new SerialPort(); if (File.Exists("favicon.ico")) { WindowIcon = new Icon(Path.Combine(MdConstant.root, MdConstant.N_ICON)); } CurrentInputMethod = MdConfig.Main.GetCurrentInputMethod(); KeyGroup = MdCore.Deserialize <ClKeyGroup>(Path.Combine(MdPersistentData.ConfigPath, MdConstant.D_KEYGROUP, "Core" + MdConstant.E_KEYGROUP)); }