Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows;
- using System.Windows.Input;
- using NHotkey;
- using NHotkey.Wpf;
- using WindowsInput;
- using WindowsInput.Native;
- namespace test
- {
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- ConsoleWindow.ShowConsoleWindow();
- try
- {
- HotkeyManager.Current.AddOrReplace("Test", Key.G, ModifierKeys.Alt, Test);
- }
- catch (HotkeyAlreadyRegisteredException e)
- {
- Console.WriteLine(e.Message);
- }
- }
- private static void Test(object sender, EventArgs e)
- {
- Console.WriteLine("test");
- var simu = new InputSimulator();
- simu.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_A);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement