private CapturedItemsListController(MainWindow mainWindow)
        {
            this.mainWindow = mainWindow;
            this.mainWindowPtr = new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle;

            f = new System.Windows.Forms.Form();
            sh = new ShellHook(f.Handle);
            sh.WindowActivated += sh_WindowActivated;
            sh.RudeAppActivated += sh_WindowActivated;
            ch = new ClipboardHelper(f.Handle);
            ch.ClipboardGrabbed += ch_ClipboardGrabbed;
            ch.RegisterClipboardListener();

            gh = new GlobalHotkeyHelper(f.Handle);
            gh.GlobalHotkeyFired += new GlobalHotkeyHandler(gh_GlobalHotkeyFired);

            gh.RegisterHotKey(666, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_Z);
            gh.RegisterHotKey(667, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_1);
            gh.RegisterHotKey(668, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_2);
            gh.RegisterHotKey(669, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_3);
            gh.RegisterHotKey(670, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_4);
            gh.RegisterHotKey(671, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_5);
            gh.RegisterHotKey(672, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_6);
            gh.RegisterHotKey(673, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_7);
            gh.RegisterHotKey(674, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_8);
            gh.RegisterHotKey(675, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_9);
            gh.RegisterHotKey(676, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_0);
        }
Esempio n. 2
0
        private void registerHotKeys()
        {
            //bind to clipboard
            ShellHook sh;
            ClipboardHelper ch;
            GlobalHotkeyHelper gh;
            System.Windows.Forms.Form f;

            f = new System.Windows.Forms.Form();
            sh = new ShellHook(f.Handle);
            //sh.WindowActivated += sh_WindowActivated;
            //sh.RudeAppActivated += sh_WindowActivated;
            ch = new ClipboardHelper(f.Handle);
            ch.ClipboardGrabbed += ch_ClipboardGrabbed;
            ch.RegisterClipboardListener();

            gh = new GlobalHotkeyHelper(f.Handle);
            gh.GlobalHotkeyFired += new GlobalHotkeyHandler(gh_GlobalHotkeyFired);

            //gh.RegisterHotKey(72783, KeyModifiers.Control, VirtualKeys.VK_COMMA);
            //gh.RegisterHotKey(72784, KeyModifiers.Alt, VirtualKeys.VK_PERIOD);
            gh.RegisterHotKey(72784, KeyModifiers.Control, VirtualKeys.VK_2);
        }