Beispiel #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];
                }
            }
        }
Beispiel #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;
        }
 private static KeyObject NewKeyObjectVirtualKey(Keys[] virtualKeys) => new KeyObject
     (Keys.None, true, new KeyScript(new RuntimeScript("NUMC.VirtualKey", VirtualInputRuntime.ConvertString(virtualKeys))));