Ejemplo n.º 1
0
 private void Register()
 {
     if (!string.IsNullOrEmpty(txtTakePicture.Text) && txtTakePicture.Text != Keys.None.ToString())
     {
         LocalHotKey NewLocalHotKey = new LocalHotKey("takePicture", txtTakePicture.UserModifier, txtTakePicture.UserKey);
         NewLocalHotKey.Tag = "takePicture";
         hotKeyManager.AddLocalHotKey(NewLocalHotKey);
     }
     if (!string.IsNullOrEmpty(txtZoomIn.Text) && txtZoomIn.Text != Keys.None.ToString())
     {
         LocalHotKey NewLocalHotKey = new LocalHotKey("zoomIn", txtZoomIn.UserModifier, txtZoomIn.UserKey);
         NewLocalHotKey.Tag = "zoomIn";
         hotKeyManager.AddLocalHotKey(NewLocalHotKey);
     }
     if (!string.IsNullOrEmpty(txtZoomOut.Text) && txtZoomOut.Text != Keys.None.ToString())
     {
         LocalHotKey NewLocalHotKey = new LocalHotKey("zoomOut", txtZoomOut.UserModifier, txtZoomOut.UserKey);
         NewLocalHotKey.Tag = "zoomOut";
         hotKeyManager.AddLocalHotKey(NewLocalHotKey);
     }
     if (!string.IsNullOrEmpty(txtStart.Text) && txtStart.Text != Keys.None.ToString())
     {
         LocalHotKey NewLocalHotKey = new LocalHotKey("startRecord", txtStart.UserModifier, txtStart.UserKey);
         NewLocalHotKey.Tag = "startRecord";
         hotKeyManager.AddLocalHotKey(NewLocalHotKey);
     }
     if (!string.IsNullOrEmpty(txtFire.Text) && txtFire.Text != Keys.None.ToString())
     {
         LocalHotKey NewLocalHotKey = new LocalHotKey("fireLaser", txtFire.UserModifier, txtFire.UserKey);
         NewLocalHotKey.Tag = "fireLaser";
         hotKeyManager.AddLocalHotKey(NewLocalHotKey);
     }
 }
Ejemplo n.º 2
0
        void RegisterHotKeys()
        {
            ghkNotepad.Enabled   = chkNotepad.Checked;
            ghkWordpad.Enabled   = chkWordpad.Checked;
            ghkCalc.Enabled      = chkCalculator.Checked;
            ghkTaskMan.Enabled   = chkTaskManager.Checked;
            ghkUninstall.Enabled = chkUninstall.Checked;
            ghkCustom.Enabled    = chkCustomEnabled.Checked;

            lhkNewHotkey.Enabled   = chkNewHotKey.Checked;
            lhkNewLocalKey.Enabled = chkNewLocal.Checked;
            lhkCopyLog.Enabled     = chkCopyClipboard.Checked;
            lhkClearLog.Enabled    = chkCopyClipboard.Checked;
            lhkDisableLog.Enabled  = chkDisableLogging.Checked;

            //Store an information in the tag of the hotkeys.
            ghkNotepad.Tag   = "Notepad.exe";
            ghkWordpad.Tag   = "Wordpad.exe";
            ghkCalc.Tag      = "Calc.exe";
            ghkTaskMan.Tag   = "Taskmgr.exe";
            ghkUninstall.Tag = "appwiz.cpl";

            chotCmd.Tag        = "cmd.exe";
            chotPowerShell.Tag = "powershell.exe";
            chotIExplore.Tag   = "iexplore.exe";
            chotRegEdit.Tag    = "regedit.exe";
            chotCharMap.Tag    = "charmap.exe";

            lhkNewHotkey.HotKeyPressed += delegate { AddNewHotKey(); };

            //Now, we'll add the Keys to the HotKeyManager
            MyHotKeyManager.AddGlobalHotKey(ghkNotepad);
            MyHotKeyManager.AddGlobalHotKey(ghkWordpad);
            MyHotKeyManager.AddGlobalHotKey(ghkCalc);
            MyHotKeyManager.AddGlobalHotKey(ghkTaskMan);
            MyHotKeyManager.AddGlobalHotKey(ghkUninstall);
            MyHotKeyManager.AddGlobalHotKey(ghkCustom);
            //Add the Local HotKeys.
            MyHotKeyManager.AddLocalHotKey(lhkNewHotkey);
            MyHotKeyManager.AddLocalHotKey(lhkNewLocalKey);
            MyHotKeyManager.AddLocalHotKey(lhkCopyLog);
            MyHotKeyManager.AddLocalHotKey(lhkClearLog);
            MyHotKeyManager.AddLocalHotKey(lhkDisableLog);
            //Add the Chord HotKeys.
            MyHotKeyManager.AddChordHotKey(chotCmd);
            MyHotKeyManager.AddChordHotKey(chotPowerShell);
            MyHotKeyManager.AddChordHotKey(chotIExplore);
            MyHotKeyManager.AddChordHotKey(chotRegEdit);
            MyHotKeyManager.AddChordHotKey(chotCharMap);
        }
Ejemplo n.º 3
0
        void RegisterHotKeys()
        {
            MyHotKeyManager = new HotKeyManager(this);

            MyHotKeyManager.AddGlobalHotKey(ghkPlay);
            MyHotKeyManager.AddGlobalHotKey(ghkStop);
            MyHotKeyManager.AddGlobalHotKey(ghkFile);

            MyHotKeyManager.AddLocalHotKey(lhkPlay);
            MyHotKeyManager.AddLocalHotKey(lhkStop);
            MyHotKeyManager.AddLocalHotKey(lhkFile);
            MyHotKeyManager.AddLocalHotKey(lhkScreen);

            MyHotKeyManager.AddChordHotKey(chotPlay);
            MyHotKeyManager.AddChordHotKey(chotStop);
            MyHotKeyManager.AddChordHotKey(chotFile);

            MyHotKeyManager.GlobalHotKeyPressed += new GlobalHotKeyEventHandler(MyHotKeyManager_GlobalHotKeyPressed);
            MyHotKeyManager.LocalHotKeyPressed  += new LocalHotKeyEventHandler(MyHotKeyManager_LocalHotKeyPressed);
            MyHotKeyManager.ChordPressed        += new ChordHotKeyEventHandler(MyHotKeyManager_ChordPressed);
        }
Ejemplo n.º 4
0
        public FormPOS()
        {
            InitializeComponent();
            MyHotKeyManager = new HotKeyManager(this);
            MyHotKeyManager.LocalHotKeyPressed += new LocalHotKeyEventHandler(MyHotKeyManager_LocalHotKeyPressed);

            lhkNewInvoice.Enabled    = true;
            lhkResetInvoice.Enabled  = true;
            lhkItemInvoice.Enabled   = true;
            lhkDeleteInvoice.Enabled = true;
            lhkCashInvoice.Enabled   = true;
            lhkSaveInvoice.Enabled   = true;
            lhkDiscount.Enabled      = true;

            MyHotKeyManager.AddLocalHotKey(lhkNewInvoice);
            MyHotKeyManager.AddLocalHotKey(lhkResetInvoice);
            MyHotKeyManager.AddLocalHotKey(lhkItemInvoice);
            MyHotKeyManager.AddLocalHotKey(lhkDeleteInvoice);
            MyHotKeyManager.AddLocalHotKey(lhkCashInvoice);
            MyHotKeyManager.AddLocalHotKey(lhkSaveInvoice);
            MyHotKeyManager.AddLocalHotKey(lhkDiscount);

            //MyHotKeyManager.DisableOnManagerFormInactive = true;
        }
Ejemplo n.º 5
0
        private void HotkeyInit()
        {
            MyHotKeyManager = new HotKeyManager(mapEditor.mainWindow);


            //TODO 단축기 설정 옵션
            {
                LocalHotKey hoykey = new LocalHotKey("New", ModifierKeys.Control, Keys.N);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Open", ModifierKeys.Control, Keys.O);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Save", ModifierKeys.Control, Keys.S);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Undo", ModifierKeys.Control, Keys.Z);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Redo", ModifierKeys.Control, Keys.U);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("GridUp", ModifierKeys.Control, Keys.Q);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("GridDown", ModifierKeys.Control, Keys.E);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }


            {
                LocalHotKey hoykey = new LocalHotKey("Delete", Keys.Delete);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Enter", Keys.Enter);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Copy", ModifierKeys.Control, Keys.C);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Paste", ModifierKeys.Control, Keys.V);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Cut", ModifierKeys.Control, Keys.X);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }



            {
                LocalHotKey hoykey = new LocalHotKey("CopyPaste", ModifierKeys.Control, Keys.Oemtilde);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Tileset", ModifierKeys.Control, Keys.D1);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Doodad", ModifierKeys.Control, Keys.D2);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Unit", ModifierKeys.Control, Keys.D3);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Sprite", ModifierKeys.Control, Keys.D4);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("Location", ModifierKeys.Control, Keys.D5);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }
            {
                LocalHotKey hoykey = new LocalHotKey("FogofWar", ModifierKeys.Control, Keys.D6);
                MyHotKeyManager.AddLocalHotKey(hoykey);
            }

            //TODO WASD단축키
            {
                Whoykey = new LocalHotKey("W", ModifierKeys.None, Keys.W, RaiseLocalEvent.OnKeyDown);
                MyHotKeyManager.AddLocalHotKey(Whoykey);
            }
            {
                Ahoykey = new LocalHotKey("A", ModifierKeys.None, Keys.A, RaiseLocalEvent.OnKeyDown);
                MyHotKeyManager.AddLocalHotKey(Ahoykey);
            }
            {
                Shoykey = new LocalHotKey("S", ModifierKeys.None, Keys.S, RaiseLocalEvent.OnKeyDown);
                MyHotKeyManager.AddLocalHotKey(Shoykey);
            }
            {
                Dhoykey = new LocalHotKey("D", ModifierKeys.None, Keys.D, RaiseLocalEvent.OnKeyDown);
                MyHotKeyManager.AddLocalHotKey(Dhoykey);
            }



            MyHotKeyManager.LocalHotKeyPressed += MyHotKeyManager_LocalHotKeyPressed;
        }