Exemple #1
0
 public ConfigState()
 {
     /* Set default values */
     fastTagging             = false;
     currentDatabase         = Constants.DEFAULT_DB_NAME;
     lang                    = null;
     autoSave                = false;
     captureVideoStandard    = VideoStandards.P480_16_9.Clone();
     captureEncodingProfile  = EncodingProfiles.MP4.Clone();
     captureEncodingQuality  = EncodingQualities.Medium.Clone();
     renderVideoStandard     = VideoStandards.P720_16_9.Clone();
     renderEncodingProfile   = EncodingProfiles.MP4.Clone();
     renderEncodingQuality   = EncodingQualities.High.Clone();
     overlayTitle            = true;
     enableAudio             = false;
     fps_n                   = 25;
     fps_d                   = 1;
     autorender              = false;
     autorenderDir           = null;
     lastRenderDir           = null;
     lastDir                 = null;
     reviewPlaysInSameWindow = true;
     defaultTemplate         = null;
     hotkeys                 = new Hotkeys();
     projectSortMethod       = ProjectSortMethod.Date;
     ignoreUpdaterVersion    = null;
 }
Exemple #2
0
        private void EditHotkey(Hotkey hk)
        {
            using (var qf = new QuickForm("Enter New Hotkey")
                            .Item(new HotkeyQuickFormItem("Hotkey", hk.HotkeyString))
                            .OkCancel())
            {
                if (qf.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                var key = qf.String("Hotkey");
                if (String.IsNullOrWhiteSpace(key))
                {
                    return;
                }

                var conflict = _hotkeys.FirstOrDefault(x => x.HotkeyString == key && x != hk);
                if (conflict != null)
                {
                    if (MessageBox.Show(key + " is already assigned to \"" + Hotkeys.GetHotkeyDefinition(conflict.ID) + "\".\n" +
                                        "Continue anyway?", "Conflict Detected", MessageBoxButtons.YesNo) == DialogResult.No)
                    {
                        return;
                    }
                }

                hk.HotkeyString = key;
                UpdateHotkeyList();
            }
        }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     hk        = Hotkeys.loadHotkeys();
     keybind   = hk.loadHotkeySpecific(12).ToString();
     text      = GetComponent <Text>();
     text.text = "Press " + keybind + " to Continue";
 }
Exemple #4
0
        public static IntPtr HotKeyHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            const int WM_HOTKEY = 0x0312;

            switch (msg)
            {
            case WM_HOTKEY:
                //switch (wParam.ToInt32())
                //{
                //case 0:
                //case 1:
                var k = new Hotkey(
                    (lParam.ToInt32() >> 16),
                    (lParam.ToInt32() & MOD_ALT) > 0,
                    (lParam.ToInt32() & MOD_SHIFT) > 0,
                    (lParam.ToInt32() & MOD_CONTROL) > 0
                    );
                var a = (lParam.ToInt32() & MOD_ALT) > 0;
                var b = (lParam.ToInt32() & MOD_SHIFT) > 0;
                var c = (lParam.ToInt32() & MOD_CONTROL) > 0;
                if (Hotkeys.ContainsKey(k))
                {
                    Hotkeys[k].Callback.Invoke();
                }
                handled = true;             // TODO: Find a way to not always capture the hotkey
                break;
                //}break;
            }
            return(IntPtr.Zero);
        }
Exemple #5
0
        private void HotkeyAddButtonClicked(object sender, EventArgs e)
        {
            var key = HotkeyCombination.Text;

            if (HotkeyActionList.SelectedIndex <= 0 || String.IsNullOrWhiteSpace(key))
            {
                return;
            }
            var conflict = _hotkeys.FirstOrDefault(x => x.HotkeyString == key);

            if (conflict != null)
            {
                if (MessageBox.Show(key + " is already assigned to \"" + Hotkeys.GetHotkeyDefinition(conflict.ID) + "\".\n" +
                                    "Continue anyway?", "Conflict Detected", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }
            var def   = (HotkeyDefinition)HotkeyActionList.SelectedItem;
            var blank = _hotkeys.FirstOrDefault(x => x.ID == def.ID && String.IsNullOrWhiteSpace(x.HotkeyString));

            if (blank == null)
            {
                _hotkeys.Add(new Hotkey {
                    ID = def.ID, HotkeyString = key
                });
            }
            else
            {
                blank.HotkeyString = key;
            }
            HotkeyCombination.Text = "";
            UpdateHotkeyList();
        }
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveGeneralSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <Rubberduck.Settings.GeneralSettings> {
             FilePath = dialog.FileName
         };
         service.Save(GetCurrentGeneralSettings());
         var hkService = new XmlPersistanceService <HotkeySettings> {
             FilePath = dialog.FileName
         };
         hkService.Save(new HotkeySettings {
             Settings = Hotkeys.ToArray()
         });
     }
 }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     hk        = Hotkeys.loadHotkeys();
     keybind   = hk.loadHotkeySpecific(11).ToString();
     text      = GetComponent <TextMesh>();
     text.text = "Press " + keybind + " to Interact";
 }
Exemple #8
0
    // 初期化メソッド
    void Start()
    {
        // 自分に設定されているAnimatorコンポーネントを習得する
        this.animator = GetComponent <Animator>();

        // load hotkeys
        hk       = Hotkeys.loadHotkeys();
        keybind1 = hk.loadHotkeySpecific(5);
        keybind2 = hk.loadHotkeySpecific(6);
        keybind3 = hk.loadHotkeySpecific(7);
        keybind4 = hk.loadHotkeySpecific(8);
        up       = hk.loadHotkeySpecific(0);
        down     = hk.loadHotkeySpecific(1);
        left     = hk.loadHotkeySpecific(2);
        right    = hk.loadHotkeySpecific(3);
        dash     = hk.loadHotkeySpecific(10);

        // load attacks
        atk1 = GetComponent <ExampleAttack>();
        atk2 = GetComponent <AttackWithRecoilDamage>();
        atk3 = GetComponent <AttackThatCanHitSelf>();
        atk4 = GetComponent <Shoot>();

        //load movement
        movement = GetComponent <PlayerMovement1>();
    }
Exemple #9
0
 private void ProcessHotkey(int hotkeyId)
 {
     if (Hotkeys.ContainsKey(hotkeyId))
     {
         Hotkeys[hotkeyId].Action();
     }
 }
Exemple #10
0
 private void Start()
 {
     playerBlinking = GetComponent <Player>();
     playerMovement = GetComponent <PlayerMovement>();
     hotkeys        = GameObject.Find("_SCRIPTS_").
                      GetComponent <Hotkeys>();
 }
Exemple #11
0
        private static void DisableRun()
        {
            Running = false;

            /*
             * if (Recording) {
             *  controller.WriteInputs();
             * }
             */
            Recording = false;
            State     = State.None;
            NextState = State.None;
            BindingHelper.RestorePlayerBindings();
            Celeste.Mod.Core.CoreModule.Settings.UseKeyboardForTextInput = KbTextInput;
            Controller.ResetSpawn = null;
            if (ExportSyncData)
            {
                EndExport();
                ExportSyncData = false;
            }

            LibTasHelper.EndExport();

            EnforceLegal     = false;
            AllowUnsafeInput = false;
            AnalogHelper.AnalogModeChange(AnalogueMode.Ignore);
            Hotkeys.ReleaseAllKeys();
            RestoreSettings.TryRestore();
        }
Exemple #12
0
        /// <summary>Initializes this plugin.</summary>
        public void Initialize()
        {
            // Make life easier!

            Hotkeys.Register("DevTab.RunCode", System.Windows.Forms.Keys.Q,
                             ModifierKeys.Alt | ModifierKeys.Shift,
                             h =>
            {
                if (!PluginManager.IsEnabled(this))
                {
                    return;
                }

                if (_instance != null)
                {
                    _instance.Dispatcher.BeginInvoke(new Action(() => _instance.ButtonExecuteText_Click(null, null)));
                }
            });

            Hotkeys.Register("DevTab.RunFile", System.Windows.Forms.Keys.Z,
                             ModifierKeys.Alt | ModifierKeys.Shift,
                             h =>
            {
                if (!PluginManager.IsEnabled(this))
                {
                    return;
                }

                if (_instance != null)
                {
                    _instance.Dispatcher.BeginInvoke(new Action(() => _instance.ButtonExecuteFile_Click(null, null)));
                }
            });
        }
        public static void Initialize()
        {
            EnableAoe        = true;
            PauseRotation    = false;
            EnableInterrupts = true;
            EnableCharge     = true;
            EnableSolo       = false;
            EnableHK55       = false;

            //F9 and F10 are reservered for internal commands

            Hotkeys.RegisterHotkey("Toggle HK55 (F4)", ChangeHK55, Keys.F4);
            Logger.Write("[Hot Key][F4] Toggle HK55");

            Hotkeys.RegisterHotkey("Toggle Interrupts (F5)", ChangeInterrupts, Keys.F5);
            Logger.Write("[Hot Key][F5] Toggle Interrupts");

            Hotkeys.RegisterHotkey("Toggle Charge (F6)", ChangeCharge, Keys.F6);
            Logger.Write("[Hot Key][F6] Toggle Charge");

            Hotkeys.RegisterHotkey("Toggle AOE (F7)", ChangeAoe, Keys.F7);
            Logger.Write("[Hot Key][F7] Toggle AOE");

            Hotkeys.RegisterHotkey("Pause Rotation (F8)", ChangePause, Keys.F8);
            Logger.Write("[Hot Key][F8] Pause Rotation");

            Hotkeys.RegisterHotkey("Toggle Solo (F11)", ChangeSolo, Keys.F11);
            Logger.Write("[Hot Key][F11] Toggle Solo Mode");

            Hotkeys.RegisterHotkey("Set Tank (F12)", Targeting.SetTank, Keys.F12);
            Logger.Write("[Hot Key][F12] Set Tank");
        }
Exemple #14
0
 public void UpdateConfig(Configuration config)
 {
     config.UserSettings.GeneralSettings.Language        = SelectedLanguage;
     config.UserSettings.GeneralSettings.HotkeySettings  = Hotkeys.ToArray();
     config.UserSettings.GeneralSettings.AutoSaveEnabled = AutoSaveEnabled;
     config.UserSettings.GeneralSettings.AutoSavePeriod  = AutoSavePeriod;
 }
Exemple #15
0
 public void UnregisterAllHotkeys(bool removeFromList = true)
 {
     foreach (HotkeySettings hotkeySetting in Hotkeys.ToArray())
     {
         UnregisterHotkey(hotkeySetting, removeFromList);
     }
 }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int    command   = (int)((HotkeyTypeEnum)cbAddType.SelectedValue);
            Hotkey newHotkey = HotkeyTypeFactory.GetHotkeyType(command);

            newHotkey.Command = command;
            Form        hotkeyEdit     = HotkeyEditFormFactory.GetHotkeyEditForm(newHotkey.Command, newHotkey);
            IHotkeyForm hotkeyEditConv = null;

            if (hotkeyEdit is IHotkeyForm)
            {
                hotkeyEditConv = (IHotkeyForm)hotkeyEdit;
            }
            else
            {
                throw new Exception("Somehow the form doesn't cast to IHotkeyForm. Developer bad! Bad developer!");
            }
            DialogResult result = hotkeyEdit.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                Hotkeys.Add(hotkeyEditConv.Hotkey);
                AddedHotkeys.Add(hotkeyEditConv.Hotkey);
            }
        }
Exemple #17
0
 public void RegisterAllHotkeys()
 {
     foreach (HotkeySettings hotkeySetting in Hotkeys.ToArray())
     {
         RegisterHotkey(hotkeySetting);
     }
 }
Exemple #18
0
        public void RegisterHotkey(HotkeySettings hotkeySetting)
        {
            if (!Program.Settings.DisableHotkeys || hotkeySetting.TaskSettings.Job == HotkeyType.DisableHotkeys)
            {
                UnregisterHotkey(hotkeySetting, false);

                if (hotkeySetting.HotkeyInfo.Status != HotkeyStatus.Registered && hotkeySetting.HotkeyInfo.IsValidHotkey)
                {
                    hotkeyForm.RegisterHotkey(hotkeySetting.HotkeyInfo);

                    if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.Registered)
                    {
                        DebugHelper.WriteLine("Hotkey registered: " + hotkeySetting);
                    }
                    else if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.Failed)
                    {
                        DebugHelper.WriteLine("Hotkey register failed: " + hotkeySetting);
                    }
                }
            }

            if (!Hotkeys.Contains(hotkeySetting))
            {
                Hotkeys.Add(hotkeySetting);
            }
        }
Exemple #19
0
 public static void InsertHotkey(Hotkeys hotkey)
 {
     if (hotkey != null && !(string.IsNullOrWhiteSpace(hotkey.Key) || string.IsNullOrWhiteSpace(hotkey.Modifiers) || string.IsNullOrWhiteSpace(hotkey.Name)))
     {
         DLLocalDatabase.Hotkey.InsertHotkey(hotkey);
     }
 }
Exemple #20
0
        private void tbCheckTimerHotKey_KeyUp(object sender, KeyEventArgs e)
        {
            if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return.
                return;

            //Good! now let's check if the KeyCode is not alt shift or ctr
            if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey)
                return;

            BLIO.Log("tbCheckTimerHotKey legal key combination pressed.");


            tbCheckTimerHotKey.Text = "";

            foreach (string m in e.Modifiers.ToString().Split(','))
            {
                tbCheckTimerHotKey.Text += m + " + ";
            }
            tbCheckTimerHotKey.Text += e.KeyCode.ToString();

            BLIO.Log("tbCheckTimerHotKey key combination: " + tbCheckTimerHotKey.Text);

            //Get the current key combination for the Timer popup
            Hotkeys timerCheckKey = BLLocalDatabase.Hotkey.TimerCheck;
            timerCheckKey.Key = e.KeyCode.ToString();                                   //Set the new key
            timerCheckKey.Modifiers = e.Modifiers.ToString().Replace(" ", string.Empty); //Set the new modifier(remove whitespace)
            BLLocalDatabase.Hotkey.TimerCheck = timerCheckKey;                                       //Assign the value
            BLIO.Log("TimerCheck.Key=" + timerCheckKey.Key + "   TimerCheck.Modifiers=" + timerCheckKey.Modifiers);
        }
Exemple #21
0
        private void AddHotkeyCommandExecute([NotNull] object obj)
        {
            Assert.ArgumentNotNull(obj, "obj");

            var oldHotkey = new Hotkey();

            oldHotkey.Actions.Add(new SendTextAction());
            var hotKeyToAdd      = new GlobalHotkeyViewModel(oldHotkey, _actionDescriptions);
            var hotKeyEditDialog = new GlobalHotkeyEditDialog {
                DataContext = hotKeyToAdd, Owner = (Window)obj
            };

            var dialogResult = hotKeyEditDialog.ShowDialog();

            if (dialogResult.HasValue && dialogResult.Value)
            {
                var hotkeyViewModel = Hotkeys.FirstOrDefault(hotk => hotk.Key == hotKeyToAdd.Key && hotk.ModifierKeys == hotKeyToAdd.ModifierKeys);
                if (hotkeyViewModel != null)
                {
                    Hotkeys.Remove(hotkeyViewModel);
                }

                var hotkey = _hotkeys.FirstOrDefault(hotk => hotk.Key == hotKeyToAdd.Key && hotk.ModifierKeys == hotKeyToAdd.ModifierKeys);
                if (hotkey != null)
                {
                    _hotkeys.Remove(hotkey);
                }

                Hotkeys.Add(hotKeyToAdd);
                _hotkeys.Add(hotKeyToAdd.Hotkey);
            }
        }
Exemple #22
0
        public static void Initialize()
        {
            EnableAoe        = true;
            PauseRotation    = false;
            EnableInterrupts = true;
            EnableCharge     = true;
            EnableRaidBuffs  = false;

            //F9 and F10 are reservered for internal commands

            Hotkeys.RegisterHotkey("Toggle RaidBuffs (F4)", ChangeRaidBuffs, Keys.F4);
            Logger.Write("[Hot Key][F4] Toggle Raid Buffs");

            Hotkeys.RegisterHotkey("Toggle Interrupts (F5)", ChangeInterrupts, Keys.F5);
            Logger.Write("[Hot Key][F5] Toggle Interrupts");

            Hotkeys.RegisterHotkey("Toggle Charge (F6)", ChangeCharge, Keys.F6);
            Logger.Write("[Hot Key][F6] Toggle Charge");

            Hotkeys.RegisterHotkey("Toggle AOE (F7)", ChangeAoe, Keys.F7);
            Logger.Write("[Hot Key][F7] Toggle AOE");

            Hotkeys.RegisterHotkey("Pause Rotation (F8)", ChangePause, Keys.F8);
            Logger.Write("[Hot Key][F8] Pause Rotation");

            Logger.Write("[Hot Key][F9] Pause/Resume Bot");

            Logger.Write("[Hot Key][F10] Start/Stop Bot");

            Hotkeys.RegisterHotkey("Set Tank (F12)", Targeting.SetTank, Keys.F12);
            Logger.Write("[Hot Key][F12] Set Tank");
        }
 public void RegisterHotkeys(Hotkeys hotkeys)
 {
     foreach (var hotkey in hotkeys)
     {
         RegisterHotkey(hotkey.Key, hotkey.Value);
     }
 }
 public override void OnHotkey(Hotkeys hk)
 {
     if (hk == Hotkeys.ResetViewport)
     {
         aleViewport.ResetControls();
     }
 }
Exemple #25
0
 void Start()
 {
     textCanvas       = dialogueCanvas.GetComponentInChildren <Button>().GetComponentInChildren <Text>();
     hk               = Hotkeys.loadHotkeys();
     callDialogue     = hk.loadHotkeySpecific(11);
     continueDialogue = hk.loadHotkeySpecific(12);
 }
Exemple #26
0
        /// <summary>
        /// Looks for key combinations to launch the timer form (to set a timer quickly)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">The keyeventargs which contains the pressed keys</param>
        private void GlobalKeyPress(object sender, KeyEventArgs e)
        {
            if (BLSettings.GetSettings().EnableQuickTimer != 1) //Not enabled? don't do anything
            {
                return;
            }

            if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return.
            {
                return;
            }

            //Good! now let's check if the KeyCode is not alt shift or ctr
            if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey)
            {
                return;
            }

            timerHotkey = BLHotkeys.TimerPopup;

            if (e.Modifiers.ToString().Replace(" ", string.Empty) == timerHotkey.Modifiers && e.KeyCode.ToString() == timerHotkey.Key)
            {
                BLIO.Log("Timer hotkey combination pressed!");
                TimerPopup quickTimer = new TimerPopup();
                quickTimer.Show();
            }
        }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (dgvHotkeys.SelectedRows.Count > 0)
     {
         Hotkey selectedHotkey = (Hotkey)dgvHotkeys.SelectedRows[0].DataBoundItem;
         if (selectedHotkey != null)
         {
             Form        hotkeyEdit     = HotkeyEditFormFactory.GetHotkeyEditForm(selectedHotkey.Command, selectedHotkey);
             IHotkeyForm hotkeyEditConv = null;
             if (hotkeyEdit is IHotkeyForm)
             {
                 hotkeyEditConv = (IHotkeyForm)hotkeyEdit;
             }
             else
             {
                 throw new Exception("Somehow the form doesn't cast to IHotkeyForm. Developer bad! Bad developer!");
             }
             DialogResult result = hotkeyEdit.ShowDialog();
             if (result == System.Windows.Forms.DialogResult.OK)
             {
                 Hotkeys.Remove(selectedHotkey);
                 RemovedHotkeys.Add(selectedHotkey);
                 Hotkeys.Add(hotkeyEditConv.Hotkey);
                 AddedHotkeys.Add(hotkeyEditConv.Hotkey);
             }
         }
     }
 }
Exemple #28
0
        private void tbTimerHotkey_KeyUp(object sender, KeyEventArgs e)
        {
            if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return.
            {
                return;
            }

            //Good! now let's check if the KeyCode is not alt shift or ctr
            if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey)
            {
                return;
            }


            tbTimerHotkey.Text = "";

            foreach (string m in e.Modifiers.ToString().Split(','))
            {
                tbTimerHotkey.Text += m + " + ";
            }
            tbTimerHotkey.Text += e.KeyCode.ToString();

            //Get the current key combination for the Timer popup
            Hotkeys timerKey = BLHotkeys.TimerPopup;

            timerKey.Key         = e.KeyCode.ToString();                              //Set the new key
            timerKey.Modifiers   = e.Modifiers.ToString().Replace(" ", string.Empty); //Set the new modifier(remove whitespace)
            BLHotkeys.TimerPopup = timerKey;                                          //Assign the value
        }
Exemple #29
0
 public void ProcessHotkey(Hotkeys hotkey, HotkeyBinding form, TextBox textBox)
 {
     form.Close();
     textBox.Text = hotkey.subKey.ToString() + "," + hotkey.mainKey.ToString();
     textBox.Tag  = hotkey;
     SaveHotkeys();
     this.Visible = true;
 }
Exemple #30
0
 static Input()
 {
     DebugMouseCursorPos = false;
     Hotkeys.Register("TritonHs.Input.DebugMouseCursorPos", Keys.X, ModifierKeys.Shift | ModifierKeys.Alt, new Action <Hotkey>(Class237.< > 9.method_0));
     Hotkeys.Register("TritonHs.ProcessHookManager.Disable", Keys.D, ModifierKeys.Shift | ModifierKeys.Alt, new Action <Hotkey>(Class237.< > 9.method_1));
     Hotkeys.Register("TritonHs.ProcessHookManager.Enable", Keys.E, ModifierKeys.Shift | ModifierKeys.Alt, new Action <Hotkey>(Class237.< > 9.method_2));
     Hotkeys.Register("TritonHs.ProcessHookManager.Reset", Keys.R, ModifierKeys.Shift | ModifierKeys.Alt, new Action <Hotkey>(Class237.< > 9.method_3));
 }
 public KeyboardShortcut(Hotkeys hotkeys)
     : this()
 {
     this.hotkeys = hotkeys;
     HookEvents();
 }
Exemple #32
0
		public void register_hotkeys()
		{
			hook = new Hotkeys();
			hook.KeyPressed += hook_KeyPressed;
			
			try {
				hook.RegisterHotKey(global::ModifierKeys.Control | global::ModifierKeys.Shift, Keys.D3);
				hook.RegisterHotKey(global::ModifierKeys.Control | global::ModifierKeys.Shift, Keys.D4);
				hook.RegisterHotKey(global::ModifierKeys.Control | global::ModifierKeys.Shift, Keys.D5);
			} catch {
				MessageBox.Show("Couldn't register hotkeys. Perhaps they are already in use or try running as an Administrator.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
		}