Ejemplo n.º 1
0
 internal static void DoAction(object sender, HotkeyEventArgs e)
 {
     if (methodToExecute != null)
     {
         methodToExecute.Invoke();
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 5
0
 private void OnHotkey(object sender, HotkeyEventArgs e)
 {
     if (ShouldIgnoreHotkeys()) return;
     ToggleWox();
     e.Handled = true;
 }
Ejemplo n.º 6
0
 private void OnHotkey(object sender, HotkeyEventArgs e)
 {
 }
Ejemplo n.º 7
0
 private void EndEncounter_Key(object sender, HotkeyEventArgs e)
 {
     Console.WriteLine("Encounter hotkey pressed");
     EndEncounter_Click(null, null);
     e.Handled=true;
 }
Ejemplo n.º 8
0
 private void DebugMenu_Key(object sender, HotkeyEventArgs e)
 {
     Console.WriteLine("Debug hotkey pressed");
     DebugMenu.Visibility=Visibility.Visible;
     e.Handled=true;
 }
Ejemplo n.º 9
0
 private void OnHotkeyPressed(object sender, HotkeyEventArgs e)
 {
     ToggleMainWindow();
 }
Ejemplo n.º 10
0
        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;
        }
Ejemplo n.º 11
0
 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 + "'");
 }
Ejemplo n.º 12
0
 public void ScanText_HotKey(object sender, NHotkey.HotkeyEventArgs e)
 {
     StartScanScreen();
 }