Example #1
0
 internal static void DoAction(object sender, HotkeyEventArgs e)
 {
     if (methodToExecute != null)
     {
         methodToExecute.Invoke();
     }
 }
Example #2
0
 internal IntPtr HandleHotkeyMessage(
     IntPtr hwnd,
     int msg,
     IntPtr wParam,
     IntPtr lParam,
     ref bool handled,
     out Hotkey hotkey)
 {
     hotkey = null;
     if (msg == WmHotkey)
     {
         int id = wParam.ToInt32();
         string name;
         if (_hotkeyNames.TryGetValue(id, out name))
         {
             hotkey = _hotkeys[name];
             var handler = hotkey.Handler;
             if (handler != null)
             {
                 var e = new HotkeyEventArgs(name);
                 handler(this, e);
                 handled = e.Handled;
             }
         }
     }
     return IntPtr.Zero;
 }
Example #3
0
 private void EmergyStop(object sender, HotkeyEventArgs e)
 {
     using (var soundboarClient = new SoundBoardClient(_serverAddress))
     {
         soundboarClient.EmergencyStopAsync();
     }
 }
 internal IntPtr HandleHotkeyMessage(
     IntPtr hwnd,
     int msg,
     IntPtr wParam,
     IntPtr lParam,
     ref bool handled,
     out Hotkey hotkey)
 {
     hotkey = null;
     if (msg == WmHotkey)
     {
         int    id = wParam.ToInt32();
         string name;
         lock (_hotkeys)
         {
             if (_hotkeyNames.TryGetValue(id, out name))
             {
                 hotkey = _hotkeys[name];
                 var handler = hotkey.Handler;
                 if (handler != null)
                 {
                     var e = new HotkeyEventArgs(name);
                     handler(this, e);
                     handled = e.Handled;
                 }
             }
         }
     }
     return(IntPtr.Zero);
 }
Example #5
0
 private void OnHotkey(object sender, HotkeyEventArgs e)
 {
     if (ShouldIgnoreHotkeys()) return;
     ToggleWox();
     e.Handled = true;
 }
Example #6
0
 private void OnHotkey(object sender, HotkeyEventArgs e)
 {
 }
Example #7
0
 private void EndEncounter_Key(object sender, HotkeyEventArgs e)
 {
     Console.WriteLine("Encounter hotkey pressed");
     EndEncounter_Click(null, null);
     e.Handled=true;
 }
Example #8
0
 private void DebugMenu_Key(object sender, HotkeyEventArgs e)
 {
     Console.WriteLine("Debug hotkey pressed");
     DebugMenu.Visibility=Visibility.Visible;
     e.Handled=true;
 }
Example #9
0
 private void OnHotkeyPressed(object sender, HotkeyEventArgs e)
 {
     ToggleMainWindow();
 }
        void OnHotkeyOccurred(object sender, HotkeyEventArgs e)
        {
            switch (e.Name)
            {
                case ConfirmNegative:
                    SaveBg_OnClick(null, null);
                    break;
                case ConfirmPositive:
                    SaveSample_OnClick(null, null);
                    break;
                case PrevImage:
                    PredecessorImage(true);
                    break;
                case NextImage:
                    SuccessorImage(true);
                    break;
            }

            e.Handled = true;
        }
 private async Task OnHotKey(object sender, HotkeyEventArgs e)
 {
     await ((MetroWindow)Application.Current.MainWindow).ShowMessageAsync(
         "Hotkey pressed",
         "You pressed the hotkey '" + HotKey + "' registered with the name '" + e.Name + "'");
 }
Example #12
0
 public void ScanText_HotKey(object sender, NHotkey.HotkeyEventArgs e)
 {
     StartScanScreen();
 }