Exemplo n.º 1
0
        void MyHotKeyManager_LocalHotKeyPressed(object sender, LocalHotKeyEventArgs e)
        {
            switch (e.HotKey.Name.ToLower())
            {
            case "lhkplay":
                PlayPause();
                break;

            case "lhkstop":
                Stop();
                break;

            case "lhkfile":
                File();
                break;

            case "lhkscreen":
                if (this.WindowState == System.Windows.WindowState.Maximized)
                {
                    this.WindowState = System.Windows.WindowState.Normal;
                }
                else
                {
                    this.WindowState = System.Windows.WindowState.Maximized;
                }

                break;
            }
        }
Exemplo n.º 2
0
        void MyHotKeyManager_LocalHotKeyPressed(object sender, LocalHotKeyEventArgs e)
        {
            switch (e.HotKey.Name.ToLower())
            {
            case "lhkcopylog":
                if (!string.IsNullOrEmpty(txtLog.Text))
                {
                    Clipboard.SetText(txtLog.Text);
                }
                break;

            case "lhkclearlog":
                txtLog.Clear();
                return;

            case "lhkdisablelog":
                LogEvent = !LogEvent;
                break;

            case "lhknewlocalkey":
                NewLocal LocalForm = new NewLocal();
                LocalForm.MainForm = this;
                LocalForm.ShowDialog();
                break;

            default:
                if (e.HotKey.Tag != null)
                {
                    System.Diagnostics.Process.Start((string)e.HotKey.Tag);
                }
                break;
            }
            LogEvents(e.HotKey.FullInfo());
        }
Exemplo n.º 3
0
        void MyHotKeyManager_LocalHotKeyPressed(object sender, LocalHotKeyEventArgs e)
        {
            switch (e.HotKey.Name.ToLower())
            {
            case "lhknewinvoice":
                btnNew.PerformClick();
                break;

            case "lhkresetinvoice":
                button1.PerformClick();
                break;

            case "lhkiteminvoice":
                btnProduct.PerformClick();
                break;

            case "lhkdeleteinvoice":
                btnDelete.PerformClick();
                break;

            case "lhkcashinvoice":
                btnBayar.PerformClick();
                break;

            case "lhksaveinvoice":
                btnSave.PerformClick();
                break;

            case "lhkdiscount":
                btnDiscount.PerformClick();
                break;

            default:
                if (e.HotKey.Tag != null)
                {
                    System.Diagnostics.Process.Start((string)e.HotKey.Tag);
                }
                break;
            }
        }
Exemplo n.º 4
0
        private void MyHotKeyManager_LocalHotKeyPressed(object sender, LocalHotKeyEventArgs e)
        {
            if (!mapEditor.MapViewer.IsEnabled)
            {
                return;
            }
            switch (e.HotKey.Name)
            {
            case "Delete":
            {
                mapEditor.DeleteCommand();
                break;
            }

            case "Enter":
            {
                mapEditor.EditCommand();
                break;
            }

            case "Cut":
            {
                mapEditor.CutCommand();
                break;
            }

            case "Copy":
            {
                mapEditor.CopyCommand();
                break;
            }

            case "Paste":
            {
                mapEditor.PasteCommand();
                break;
            }

            case "New":
            { mapEditor.mainWindow.NewMapCommand(); break; }

            case "Open":
            { mapEditor.mainWindow.OpenMapCommand(); break; }

            case "Save":
            { mapEditor.mainWindow.SaveMapCommand(); break; }

            case "Undo":
            { mapEditor.taskManager.Undo(); break; }

            case "Redo":
            { mapEditor.taskManager.Redo(); break; }

            case "GridUp":
            { mapEditor.GridSizeUp(); break; }

            case "GridDown":
            { mapEditor.GridSizeDown(); break; }

            case "CopyPaste":
            { mapEditor.TabChange(MapEditor.Layer.CopyPaste); break; }

            case "Tileset":
            { mapEditor.TabChange(MapEditor.Layer.Tile); break; }

            case "Doodad":
            { mapEditor.TabChange(MapEditor.Layer.Doodad); break; }

            case "Unit":
            { mapEditor.TabChange(MapEditor.Layer.Unit); break; }

            case "Sprite":
            { mapEditor.TabChange(MapEditor.Layer.Sprite); break; }

            case "Location":
            { mapEditor.TabChange(MapEditor.Layer.Location); break; }

            case "FogofWar":
            { mapEditor.TabChange(MapEditor.Layer.FogOfWar); break; }

            case "W":
            {
                if (Whoykey.WhenToRaise == RaiseLocalEvent.OnKeyDown)
                {
                    mapEditor.key_WDown = true;
                    Whoykey.WhenToRaise = RaiseLocalEvent.OnKeyUp;
                }
                else
                {
                    mapEditor.key_WDown = false;
                    Whoykey.WhenToRaise = RaiseLocalEvent.OnKeyDown;
                }
                break;
            }

            case "A":
            {
                if (Ahoykey.WhenToRaise == RaiseLocalEvent.OnKeyDown)
                {
                    mapEditor.key_ADown = true;
                    Ahoykey.WhenToRaise = RaiseLocalEvent.OnKeyUp;
                }
                else
                {
                    mapEditor.key_ADown = false;
                    Ahoykey.WhenToRaise = RaiseLocalEvent.OnKeyDown;
                }
                break;
            }

            case "S":
            {
                if (Shoykey.WhenToRaise == RaiseLocalEvent.OnKeyDown)
                {
                    mapEditor.key_SDown = true;
                    Shoykey.WhenToRaise = RaiseLocalEvent.OnKeyUp;
                }
                else
                {
                    mapEditor.key_SDown = false;
                    Shoykey.WhenToRaise = RaiseLocalEvent.OnKeyDown;
                }
                break;
            }

            case "D":
            {
                if (Dhoykey.WhenToRaise == RaiseLocalEvent.OnKeyDown)
                {
                    mapEditor.key_DDown = true;
                    Dhoykey.WhenToRaise = RaiseLocalEvent.OnKeyUp;
                }
                else
                {
                    mapEditor.key_DDown = false;
                    Dhoykey.WhenToRaise = RaiseLocalEvent.OnKeyDown;
                }
                break;
            }
            }
        }