public void SelectMember2KeyPressed(Object p_sender, HotkeyEventArgs p_args) { if (m_isActive && p_args.KeyDown) { IngameController.Instance.HUDControl.OnCharacterPressed(1); } }
private void HandleToggle(object sender, HotkeyEventArgs e) { if (Settings.Default.OnboardingStep == 0) { Settings.Default.OnboardingStep += 1; Activate(); HeaderRef.QueryInput.Focus(); return; } if (Settings.Default.OnboardingStep == 1) { Settings.Default.OnboardingStep += 1; Settings.Default.ShowOnboarding = false; Settings.Default.Save(); Activate(); HeaderRef.QueryInput.Focus(); return; } if (this.Visibility == Visibility.Visible) { this.Visibility = Visibility.Hidden; } else { this.Visibility = Visibility.Visible; Activate(); HeaderRef.QueryInput.Focus(); Settings.Default.ToggleCount += 1; if (Settings.Default.ToggleCount >= 50 && Settings.Default.HasClosedDonateInfo == false) { Settings.Default.ShowDonateInfo = true; } Settings.Default.Save(); } }
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args) { if (!mainViewModel.ShouldIgnoreHotkeys() && !mainViewModel.GameModeStatus) { mainViewModel.ToggleFlowLauncher(); } }
private void OnHotkey(object sender, HotkeyEventArgs e) { if (!ShouldIgnoreHotkeys()) { if (_settings.LastQueryMode == LastQueryMode.Empty) { ChangeQueryText(string.Empty); } else if (_settings.LastQueryMode == LastQueryMode.Preserved) { LastQuerySelected = true; } else if (_settings.LastQueryMode == LastQueryMode.Selected) { LastQuerySelected = false; } else { throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>"); } ToggleWox(); e.Handled = true; } }
private void DecreaseAutoPagerInternal(object sender, HotkeyEventArgs e) { if (AutoPagerIntervalS - 1 >= 1) { AutoPagerIntervalS--; } }
private void OnConfirmKeyPressed(Object p_sender, HotkeyEventArgs p_args) { if (m_active && p_args.KeyDown) { Confirm(); } }
public void MyEventHandler(object sender, HotkeyEventArgs e) { Debug.WriteLine("Trocando para pasta: " + FolderPrincipal.GetDeckDefaultLayer.Deckname + " Atalho: " + e.Name); MainForm.Instance.CurrentDevice.CurrentProfile.Currentfolder = FolderPrincipal; MainForm.Instance.RefreshAllButtons(true); e.Handled = true; }
public void CancelKeyPressed(Object p_sender, HotkeyEventArgs p_args) { if (m_isActive && p_args.KeyDown && OnConfirm != null) { OnConfirm(null, EventArgs.Empty); } }
private void TakeScreenshot(object sender, HotkeyEventArgs e) { var simulator = new InputSimulator(); simulator.Keyboard.KeyPress(VirtualKeyCode.VK_1); System.Windows.Forms.MessageBox.Show("Should have pressed button!"); }
private static void HandleHotKeys(object sender, HotkeyEventArgs e) { NativeMethods.SetForegroundWindow(hWndSacred); if (Settings.UseSimplifiedHotKeySettings) { SendKeys.SendWait(ApplicationHotKeyGetSystemKeyValue.Get($" = {e.Name}")); e.Handled = Settings.HotKeyEventArgsGameHandled; } else { PropertyInfo propertyInfo = HotkeySettings.GameHotkeySettings.GetType().GetProperty($"Key{e.Name}"); if ((string)propertyInfo?.GetValue(HotkeySettings.GameHotkeySettings) == "None") { SendKeys.SendWait(""); } else { SendKeys.SendWait((string)propertyInfo?.GetValue(HotkeySettings.GameHotkeySettings)); } e.Handled = Settings.HotKeyEventArgsGameHandled; } }
private void OnConfirmPressed(Object p_sender, HotkeyEventArgs p_args) { if (p_args.KeyDown && m_active) { Confirm(); } }
private IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_SYSKEYDOWN) { int vkCode = Marshal.ReadInt32(lParam); switch ((Keys)vkCode) { case Keys.F1: case Keys.F2: case Keys.F3: hotkeyEvent = new HotkeyEventArgs((Keys)vkCode); HotkeyPressed?.Invoke(hotkeyEvent); break; default: break; } if (SettingsManager.Settings.ActivateKey == (Keys)vkCode) { activedEvent = new ActivatedEventArgs(); Activated?.Invoke(activedEvent); // Processed the message so return nonzero value to prevent passing value to the rest of the hook chain. return(IntPtr.Add(IntPtr.Zero, 1)); } } return(CallNextHookEx(_hookID, nCode, wParam, lParam)); }
private void OnAltP(object sender, HotkeyEventArgs e) { //FileStream fs = new FileStream(@"C:\Users\Kevin\Desktop\project.flp", FileMode.Open); //Project project = Project.Load(fs, false); //foreach (var item in project.Patterns) //{ // foreach (var note in item.Notes.Values) // { // foreach (var item2 in note) // { // item2.Key = 100; // } // } //} //fs.Dispose(); MidiFile midiRaw = Midi_Communicator.GetMidiFromFL(); MidiFile processedMidi = new Midi_Processor(midiRaw).removeNote(); Thread.Sleep(1500); //Delay because otherwise context menu may still be open Midi_Communicator.SendMidiToFL(processedMidi); }
private void OnConfirm(Object p_sender, HotkeyEventArgs p_args) { if (p_args.KeyDown && m_active && CancelBackClicked != null && !IngameController.Instance.IsAnyIngameMenuSubscreenOpen()) { CancelBackClicked(this, EventArgs.Empty); } }
private void clickTarget(object sender, HotkeyEventArgs e) { var sim = new InputSimulator(); sim.Mouse.MoveMouseTo(0, 0); sim.Mouse.RightButtonClick(); }
private void ResumeHokeyHandler(object sender, HotkeyEventArgs e) { if (OverlayWindow.IsPaused == true) { OverlayWindow.IsPaused = false; } }
/// <summary> /// When ThinkPad hotkey is pressed, handle it. /// </summary> /// <param name="sender">Should be the HotkeyService.</param> /// <param name="e">The hotkey pressed.</param> private void OnHotkeyTriggered(object sender, HotkeyEventArgs e) { var backlightService = ServiceManager.GetService <IBacklightService>(); switch (e.Key) { case TpHotkey.BrightnessIncrease: backlightService.Brightness++; //We should save the brightness here, when user adjust the brightness. backlightService.SaveBrightness(); break; case TpHotkey.BrightnessDecrease: backlightService.Brightness--; //We should save the brightness here, when user adjust the brightness. backlightService.SaveBrightness(); break; case TpHotkey.ThinkVantage: if (SettingManager.TurnOffMonitorByThinkVantage) { if (backlightService.BacklightClosed) { backlightService.TurnOnBacklight(); } else { backlightService.TurnOffBacklight(); } } break; } }
private void runAction(object sender, HotkeyEventArgs e) { var sim = Target.inputSimulator; sim.Mouse.MoveMouseTo(this.CordinateX, this.CordinateY); switch (this.MouseAction) { case Target.MouseActionType.Click: doButtonClick(this.MouseButton); break; case Target.MouseActionType.DoubleClick: doButtonDoubleClick(this.MouseButton); break; case Target.MouseActionType.Down: doButtonDown(this.MouseButton); break; case Target.MouseActionType.Up: doButtonUp(this.MouseButton); break; } }
private void OnTransparency(object sender, HotkeyEventArgs e) { //Grabs window handler to make/undo clickthrough IntPtr hwnd = new WindowInteropHelper(this).Handle; // Handles hiding elements and checking if its clickthrough. Else handles the opposite. if (e.Name == "Transparency" && !IsClickthrough) { IsClickthrough = true; Win32.MakeClickthrough(hwnd); Background = Brushes.Transparent; btnClose.Visibility = Visibility.Hidden; btnNew.Visibility = Visibility.Hidden; btnRefresh.Visibility = Visibility.Hidden; //cbFileSelect.Visibility = Visibility.Hidden; //lblFileSelect.Visibility = Visibility.Hidden; ResizeMode = ResizeMode.NoResize; rtbContent.IsEnabled = false; e.Handled = true; } else { IsClickthrough = false; Win32.UndoClickthrough(hwnd); Background = Brushes.White; btnClose.Visibility = Visibility.Visible; btnNew.Visibility = Visibility.Visible; btnRefresh.Visibility = Visibility.Visible; //cbFileSelect.Visibility = Visibility.Visible; //lblFileSelect.Visibility = Visibility.Visible; ResizeMode = ResizeMode.CanResizeWithGrip; rtbContent.IsEnabled = true; e.Handled = true; } }
private void OnOpenCloseMenu(Object p_sender, HotkeyEventArgs p_args) { if (p_args.KeyDown && m_active && CancelBackClicked != null) { CancelBackClicked(this, EventArgs.Empty); } }
private static void Get(object sender, HotkeyEventArgs e) { if (_argRun) { if (ApplicationSettingsManager.Settings.UseAsyncCreatingScreenshots) { CreateScreenShotAsync(); } else { CreateScreenShot(); } } else { if (ApplicationSettingsManager.Settings.UseAsyncCreatingScreenshots) { CreateScreenShotAsync(); } else { CreateScreenShot(); } } }
//HotKey Overload private void BtnStop_Click(object sender, HotkeyEventArgs e) { if (btnStopBot.IsEnabled) { if (t != null) { t.Abort(); } DisableButtons(); btnExitBot.IsEnabled = true; btnStopBot.IsEnabled = false; btnProcessGrab.IsEnabled = true; //initialize variables t = null; EmulatorCount = 0; listProcessList.Items.Clear(); listProcessList.Background = System.Windows.Media.Brushes.Red; } }
//HotKey Overload private void BtnExit_Click(object sender, HotkeyEventArgs e) { if (btnExitBot.IsEnabled) { System.Windows.Application.Current.Shutdown(); } }
private void OnHotkey(object sender, HotkeyEventArgs e) { if (!ShouldIgnoreHotkeys()) { if (!ResultsSelected()) { ContextMenu.Visbility = Visibility.Collapsed; History.Visbility = Visibility.Collapsed; Results.Visbility = Visibility.Visible; SelectedResults = Results; } if (_settings.LastQueryMode == LastQueryMode.Empty) { ChangeQueryText(string.Empty); } else if (_settings.LastQueryMode == LastQueryMode.Preserved) { LastQuerySelected = true; } else if (_settings.LastQueryMode == LastQueryMode.Selected) { LastQuerySelected = false; } else { throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>"); } ToggleWox(); e.Handled = true; } }
public void CancelKeyPressed(Object p_sender, HotkeyEventArgs p_args) { if (m_isActive && p_args.KeyDown) { OnResult(true); } }
private void OnHotkeyHandler(object sender, HotkeyEventArgs e) { switch (Utils.ToInt(e.Name)) { case (int)EGlobalHotkey.ShowForm: if (this.ShowInTaskbar) { HideForm(); } else { ShowForm(); } break; case (int)EGlobalHotkey.SystemProxyClear: SetListenerType(ESysProxyType.ForcedClear); break; case (int)EGlobalHotkey.SystemProxySet: SetListenerType(ESysProxyType.ForcedChange); break; case (int)EGlobalHotkey.SystemProxyUnchanged: SetListenerType(ESysProxyType.Unchanged); break; } e.Handled = true; }
private void onHotkeyUnregistered(object sender, HotkeyEventArgs e) { if (e.Label == "toggle") { updateHotkeyText(); } }
public void SelectMember4KeyPressed(Object p_sender, HotkeyEventArgs p_args) { if (p_args.KeyDown && LegacyLogic.Instance.ConversationManager.IsOpen && LegacyLogic.Instance.ConversationManager.ShowNpcs) { m_container.SelectNPCView(3); } }
public void OnExitKey(Object p_sender, HotkeyEventArgs p_args) { ConversationManager conversationManager = LegacyLogic.Instance.ConversationManager; if (p_args.KeyDown && conversationManager.IsOpen && m_finishFade && m_finishIndoorSceneLoad) { if (conversationManager.CurrentNpc != null && conversationManager.CurrentNpc.TradingInventory.IsTrading) { conversationManager.CurrentNpc.TradingInventory.StopTrading(); } else if (conversationManager.CurrentNpc != null && conversationManager.CurrentNpc.TradingSpells.IsTrading) { conversationManager.CurrentNpc.TradingSpells.StopTrading(); } else if (conversationManager.CurrentNpc != null && conversationManager.CurrentNpc.IdentifyController.IsIdentifying) { conversationManager.CurrentNpc.IdentifyController.StopIdentify(); } else if (conversationManager.CurrentNpc != null && conversationManager.CurrentNpc.RepairController.IsRepairing) { conversationManager.CurrentNpc.RepairController.StopRepair(); } else if (!PopupRequest.Instance.IsActive) { if (conversationManager.ShowNpcs) { LegacyLogic.Instance.ConversationManager.CloseNpcContainer(null); } } } }
private void SaveNote(object sender, HotkeyEventArgs e) { if (MainWindow.IsWindowInstantiated <NoteWindow>()) { viewModel.SaveNote(); Close(); } }
private void KbHook_LowLevelKeyEvent(object sender, LowLevelKbHook.LowLevelKeyEventArgs e) { Hotkey hk = TranslateEventToHotkey(e); if (hk == Hotkey.Unknown && !SendUnknownKeyEvents) return; if(HotkeyEvent != null) { HotkeyEventArgs args = new HotkeyEventArgs(hk, ModelName, e); HotkeyEvent(this, args); } }
/// <summary> /// Handles a key press event /// </summary> private void OnKeyPress(BaseKeyboardManager sender, HotkeyEventArgs args) { //handles which process was it hit on, var topmost = ProcessFinder.GetForegroundProcess().ToProcessInfo(); var topmost_log = ActiveLogs.FirstOrDefault(log => log.Process.Equals(topmost)); if (topmost_log == null) { ActiveLogs.Add(topmost_log = new ProcessLog() {Process = topmost}); topmost_log.LineClosed += line => LineClosed?.Invoke(line); } //Convert Hotkey to LogKey - includes in keyboardlayout var lk = new LogKey { Key = args.Hotkey.Key, Modifiers = args.Hotkey.Modifiers, KeyboardLayout = KeyboardLanguage.GetCurrentKeyboardLayout() }; //67699721 hebrew? topmost_log.AddContent(lk); }
private void OnIncrement(object sender, HotkeyEventArgs e) { Value++; e.Handled = true; }
private void OnHotkey(object sender, HotkeyEventArgs e) { if (!IsVisible) { ShowWox(); } else { HideWox(); } e.Handled = true; }
private void hotkey_ShowInputForm(object sender, HotkeyEventArgs e) { e.Handled = true; showInputForm(); }
protected void InvokeKeyUp(BaseKeyboardManager sender, HotkeyEventArgs args) { if (KeyUp != null) KeyUp(sender, args); }
private void OnHotkey(object sender, HotkeyEventArgs e) { if (ShouldIgnoreHotkeys()) return; ToggleWox(); e.Handled = true; }
public static HotkeyEventArgs Create(Hotkey hk) { if (hk == null) return null; var args = new HotkeyEventArgs {Hotkey = hk}; return args; }
private void OnHotkey(object sender, HotkeyEventArgs e) { ToggleWox(); e.Handled = true; }
private void HotkeySystem_Hotkey(object sender, HotkeyEventArgs e) { try { if (!mLoggedIn) return; switch (e.Title) { case "GA:GUI": if (mDefaultViewActive) DefaultView.Deactivate(); else DefaultView.Activate(); e.Eat = true; break; case "GA:ArrowHUD": ShowHideArrow(!mArrowHud.Visible); e.Eat = true; break; case "GA:DerethMap": mMapHud.Visible = !mMapHud.Visible; e.Eat = true; break; case "GA:DungeonMap": mDungeonHud.Visible = !mDungeonHud.Visible; e.Eat = true; break; case "GA:AutoMap": if (mDungeonHud.IsDungeon(Host.Actions.Landcell)) { mMapHud.Visible = false; mDungeonHud.Visible = !mDungeonHud.Visible; } else { mMapHud.Visible = !mMapHud.Visible; mDungeonHud.Visible = false; } e.Eat = true; break; case "GA:FaceDest": double angle = PlayerCoords.AngleTo(mArrowHud.DestinationCoords); while (angle < 0) angle += 2 * Math.PI; while (angle > 2 * Math.PI) angle -= 2 * Math.PI; Host.Actions.SetAutorun(false); Host.Actions.FaceHeading(angle * 180 / Math.PI, true); e.Eat = true; break; case "GA:Attach": AttachCommand(Host.Actions.CurrentSelection, true); e.Eat = true; break; } } catch (Exception ex) { Util.HandleException(ex); } }