Beispiel #1
0
        public static void addHotKeySlave(int _ID)
        {
            int ID = _ID;

            if (ID > 9 || ID < 0)
            {
                throw new Exception("range hot-key for new slave not supported");
            }

            int[] keys = getCompleteHotkey((int)Keys.NumPad0 + ID);//{ (int)Keys.LControlKey, (int)Keys.LMenu, (int)Keys.NumPad0+ID };
            //Keys[] keys = { Keys.K };
            HotKeyManager.HotKey hotKey = new HotKeyManager.HotKey(keys, () => hotkeyFocusToSlave(ID), propagateLastKey: false);
            KeyboardListener.hkm.insertHotKey(hotKey);
        }
Beispiel #2
0
        public static void fullfillHotKeys()
        {
            {
                int[] keys = getCompleteHotkey((int)Keys.M); //{ (int)Keys.LControlKey, (int)Keys.LMenu, (int)Keys.M };
                //Keys[] keys = { Keys.K };
                HotKeyManager.HotKey hotKey = new HotKeyManager.HotKey(keys, () =>
                {
                    try
                    {
                        INPUT_EXTENDED input_extended = new INPUT_EXTENDED();
                        input_extended.focusChange    = true; input_extended.focusActivateDeactivate = false; input_extended.isNotInput = true;
                        MasterGlobalVars.HookingToSocketQueue.Add(input_extended);
                        foreach (int _key in HotKeyManager.getPrefix())
                        {
                            int key = _key;//due to bug in some version of C#
                            Form1.getForm().BeginInvoke((Action)(() => WindowsInput.InputSimulator.SimulateKeyUp((WindowsInput.VirtualKeyCode)key)));
                        }
                    }
                    catch (Exception e) { }

                    KeyboardListener.blockLocalInput = false; KeyboardListener.blockRemoteInput = true;
                    MouseListener.blockLocalInput    = false; MouseListener.blockRemoteInput = true;
                }, propagateLastKey: false);
                KeyboardListener.hkm.insertHotKey(hotKey);
            }
            {
                int[] keys = getCompleteHotkey((int)Keys.S);// { (int)Keys.LControlKey, (int)Keys.LMenu, (int)Keys.S };
                //Keys[] keys = { Keys.K };
                HotKeyManager.HotKey hotKey = new HotKeyManager.HotKey(keys, () => hotkeyMasterSendClipboard(), propagateLastKey: false);
                KeyboardListener.hkm.insertHotKey(hotKey);
            }
            {
                int[] keys = getCompleteHotkey((int)Keys.G);// { (int)Keys.LControlKey, (int)Keys.LMenu, (int)Keys.G };
                //Keys[] keys = { Keys.K };
                HotKeyManager.HotKey hotKey = new HotKeyManager.HotKey(keys, () => hotkeyMasterGetClipboard(), propagateLastKey: false);
                KeyboardListener.hkm.insertHotKey(hotKey);
            }


            /*{
             *  int[] keys = { (int)Keys.LControlKey, (int)Keys.LMenu, (int)Keys.K };
             *  //Keys[] keys = { Keys.K };
             *  HotKeyManager.HotKey hotKey = new HotKeyManager.HotKey(keys, KeyboardListener.toggleLocalKeyInsert);
             *  KeyboardListener.hkm.insertHotKey(hotKey);
             * }
             * {
             *  int[] keys = { (int)Keys.LControlKey, (int)Keys.LMenu, (int)Keys.M };
             *  //Keys[] keys = { Keys.K };
             *  HotKeyManager.HotKey hotKey = new HotKeyManager.HotKey(keys, MouseListener.toggleLocalMouseInsert);
             *  KeyboardListener.hkm.insertHotKey(hotKey);
             * }
             * {
             *  int[] keys = { (int)Keys.LControlKey, (int)Keys.LMenu, (int)Keys.S };
             *  //Keys[] keys = { Keys.K };
             *  HotKeyManager.HotKey hotKey = new HotKeyManager.HotKey(keys, () =>
             *  {
             *      Socket.MasterSocket.pendingClipboard = true;
             *      INPUT_EXTENDED wake_up = new INPUT_EXTENDED();
             *      wake_up.not_send = true;
             *      MasterGlobalVars.HookingToSocketQueue.Add(wake_up);
             *  });
             *  KeyboardListener.hkm.insertHotKey(hotKey);
             * }*/
        }