예제 #1
0
        public void Initialize(Service service)
        {
            Script = service.GetScript();
            var runtimes = Script.GetRuntimes();

            for (int i = 0; i < runtimes.Count; i++)
            {
                if (runtimes[i].GetType() == typeof(VirtualInputRuntime))
                {
                    Runtime = (VirtualInputRuntime)runtimes[i];
                }
            }
        }
예제 #2
0
        public void InitializeSetting()
        {
            if (RuntimeScript != null)
            {
                var a = Array.IndexOf(VirtualInputRuntime.RuntimeNames, RuntimeScript.RuntimeName);

                ScriptTextBox.Text = a switch {
                    0 or 1 => string.Join(", ", VirtualInputRuntime.ConvertKeys(RuntimeScript.Data)),
                    _ => RuntimeScript.Data,
                };
                KeyboardTypeComboBox.SelectedIndex = a == -1 ? 0 : a;
            }
            else
            {
                KeyboardTypeComboBox.SelectedIndex = 0;
            }
            _initializedSetting = true;
        }
예제 #3
0
 private static KeyObject NewKeyObjectVirtualKey(Keys[] virtualKeys) => new KeyObject
     (Keys.None, true, new KeyScript(new RuntimeScript("NUMC.VirtualKey", VirtualInputRuntime.ConvertString(virtualKeys))));