private void HandleKeyPressEvent(object o, KeyPressEventArgs args)
        {
            var key = (Common.Configuration.Hid.Key)GTK3MappingHelper.ToInputKey(args.Event.Key);

            if (!(KeyPressedEvent?.Invoke(key)).GetValueOrDefault(true))
            {
                return;
            }

            if (_canProcessInput)
            {
                _inputToTextEntry.SendKeyPressEvent(o, args);
                _inputToTextEntry.GetSelectionBounds(out int selectionStart, out int selectionEnd);
                TextChangedEvent?.Invoke(_inputToTextEntry.Text, selectionStart, selectionEnd, _inputToTextEntry.OverwriteMode);
            }
        }
Ejemplo n.º 2
0
        void HandleKeyPressed(KeyPressedEvent e)
        {
            LMKeyAction action;

            try {
                action = App.Current.Config.Hotkeys.ActionsHotkeys.GetKeyByValue(e.Key);
            } catch (Exception ex) {
                /* The dictionary contains 2 equal values for different keys */
                Log.Exception(ex);
                return;
            }

            if (action == LMKeyAction.None || LoadedPlay == null)
            {
                return;
            }

            switch (action)
            {
            case LMKeyAction.EditEvent:
                bool playing = VideoPlayer.Playing;
                VideoPlayer.Pause();

                App.Current.EventsBroker.Publish(new EditEventEvent {
                    TimelineEvent = LoadedPlay
                });

                if (playing)
                {
                    VideoPlayer.Play();
                }
                break;

            case LMKeyAction.DeleteEvent:
                App.Current.EventsBroker.Publish(
                    new EventsDeletedEvent {
                    TimelineEvents = new List <TimelineEvent> {
                        LoadedPlay
                    }
                }
                    );
                break;
            }
        }
        private void AvaloniaDynamicTextInputHandler_KeyPressed(object sender, KeyEventArgs e)
        {
            var key = (HidKey)AvaloniaMappingHelper.ToInputKey(e.Key);

            if (!(KeyPressedEvent?.Invoke(key)).GetValueOrDefault(true))
            {
                return;
            }

            e.RoutedEvent = _hiddenTextBox.GetKeyUpRoutedEvent();

            Dispatcher.UIThread.InvokeAsync(() =>
            {
                if (_canProcessInput)
                {
                    _hiddenTextBox.SendKeyDownEvent(e);
                }
            });
        }
Ejemplo n.º 4
0
        private void HandleKeyPress(KeyPressedEvent evnt)
        {
            switch (evnt.KeyCode)
            {
            case KeyCode.W:
                _upSpeed = 1;
                break;

            case KeyCode.S:
                _downSpeed = 1;
                break;

            case KeyCode.A:
                _leftSpeed = 1;
                break;

            case KeyCode.D:
                _rightSpeed = 1;
                break;
            }
        }
Ejemplo n.º 5
0
        private static void Man_KeyPressed(KeyPressedEvent e)
        {
            ConsoleMan man = (ConsoleMan)e.Sender;

            if (e.Key == ConsoleKey.S)
            {
                PropertiesConsole properties = new PropertiesConsole();
                if (properties.form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    man.DefaultForeground = properties.DefaultForegroundProperties;
                    man.DefaultBackground = properties.DefaultBackgroundProperties;
                }
            }
            else if (e.Key == ConsoleKey.R)
            {
                FileRun.Run();
            }
            else if (e.Key == ConsoleKey.K)
            {
                dynamic process = man.SelectedItem;
                if (man.ShowDialog($"Are you sure want to kill {process.Name}?") == DialogResult.Yes)
                {
                    if (dispatcher.Kill(man.SelectedIndex))
                    {
                        man.ShowMessage("Success!", ConsoleColor.Green);
                    }
                    else
                    {
                        man.ShowMessage("Couldn't kill process. Maybe it's system process", ConsoleColor.Red);
                    }
                }
            }
            else if (e.Key == ConsoleKey.T)
            {
                Report report = new Report();
                report.DoReport(man.WindowList);
            }
        }
Ejemplo n.º 6
0
 private unsafe void OnKeyPressedEvent(KeyPressedEvent e)
 {
     ImGui.GetIO().KeysDown[(int)e.GetKeyCode()] = true;
     UpdateModifiers(e.GetKeyModifiers());
 }
Ejemplo n.º 7
0
 remove => RemoveHandler(KeyPressedEvent, value);
Ejemplo n.º 8
0
 add => AddHandler(KeyPressedEvent, value);
Ejemplo n.º 9
0
        public void DashboardKeyListener(KeyPressedEvent e)
        {
            KeyAction action;
            DashboardButton button;

            if (openedProject == null) {
                return;
            }

            try {
                action = App.Current.Config.Hotkeys.ActionsHotkeys.GetKeyByValue (e.Key);
            } catch {
                return;
            }

            if (action == KeyAction.LocalPlayer || action == KeyAction.VisitorPlayer) {
                if (inPlayerTagging) {
                    TagPlayer ();
                }
                if (pendingButton != null) {
                    analysisWindow.ClickButton (pendingButton);
                }
                inPlayerTagging = true;
                taggedTeam = action == KeyAction.LocalPlayer ? TeamType.LOCAL : TeamType.VISITOR;
                playerNumber = "";
                analysisWindow.TagTeam (taggedTeam);
                timer.Change (TIMEOUT_MS, 0);
            } else if (action == KeyAction.None) {
                if (pendingButton != null) {
                    Tag tag = pendingButton.AnalysisEventType.Tags.FirstOrDefault (t => t.HotKey == e.Key);
                    if (tag != null) {
                        analysisWindow.ClickButton (pendingButton, tag);
                        timer.Change (TIMEOUT_MS, 0);
                    }
                } else if (dashboardHotkeys.TryGetValue (e.Key, out button)) {
                    if (inPlayerTagging) {
                        TagPlayer ();
                    }
                    if (button is AnalysisEventButton) {
                        AnalysisEventButton evButton = button as AnalysisEventButton;
                        /* Finish tagging for the pending button */
                        if (pendingButton != null) {
                            analysisWindow.ClickButton (pendingButton);
                        }
                        if (evButton.AnalysisEventType.Tags.Count == 0) {
                            analysisWindow.ClickButton (button);
                        } else {
                            pendingButton = evButton;
                            timer.Change (TIMEOUT_MS, 0);
                        }
                    } else {
                        analysisWindow.ClickButton (button);
                    }
                } else if (inPlayerTagging) {
                    int number;
                    string name = App.Current.Keyboard.NameFromKeyval ((uint)e.Key.Key);
                    if (name.StartsWith ("KP_")) {
                        name = name.Replace ("KP_", "");
                    }
                    if (int.TryParse (name, out number)) {
                        playerNumber += number.ToString ();
                        timer.Change (TIMEOUT_MS, 0);
                    }
                    return;
                }
            }
        }
Ejemplo n.º 10
0
        public void UIKeyListener(KeyPressedEvent e)
        {
            KeyAction action;

            try {
                action = App.Current.Config.Hotkeys.ActionsHotkeys.GetKeyByValue(e.Key);
            } catch (Exception ex) {
                /* The dictionary contains 2 equal values for different keys */
                Log.Exception(ex);
                return;
            }

            if (action != KeyAction.None)
            {
                /*	if (analysisWindow != null) {
                 *              switch (action) {
                 *              case KeyAction.ZoomIn:
                 *                      analysisWindow.ZoomIn ();
                 *                      return;
                 *              case KeyAction.ZoomOut:
                 *                      analysisWindow.ZoomOut ();
                 *                      return;
                 *              case KeyAction.ShowDashboard:
                 *                      analysisWindow.ShowDashboard ();
                 *                      return;
                 *              case KeyAction.ShowTimeline:
                 *                      analysisWindow.ShowTimeline ();
                 *                      return;
                 *              case KeyAction.ShowPositions:
                 *                      analysisWindow.ShowZonalTags ();
                 *                      return;
                 *              case KeyAction.FitTimeline:
                 *                      analysisWindow.FitTimeline ();
                 *                      return;
                 *              }
                 *      }*/

                if (projectType == ProjectType.CaptureProject ||
                    projectType == ProjectType.FakeCaptureProject ||
                    projectType == ProjectType.URICaptureProject)
                {
                    switch (action)
                    {
                    case KeyAction.PauseClock:
                        if (capturer.Capturing)
                        {
                            capturer.PausePeriod();
                        }
                        else
                        {
                            capturer.ResumePeriod();
                        }
                        break;

                    case KeyAction.StartPeriod:
                        capturer.StartPeriod();
                        break;

                    case KeyAction.StopPeriod:
                        capturer.StopPeriod();
                        break;
                    }
                }
                else
                {
                    switch (action)
                    {
                    case KeyAction.FrameUp:
                        player.SeekToNextFrame();
                        return;

                    case KeyAction.FrameDown:
                        player.SeekToPreviousFrame();
                        return;

                    case KeyAction.JumpUp:
                        player.StepForward();
                        return;

                    case KeyAction.JumpDown:
                        player.StepBackward();
                        return;

                    case KeyAction.DrawFrame:
                        player.DrawFrame();
                        return;

                    case KeyAction.TogglePlay:
                        player.TogglePlay();
                        return;

                    case KeyAction.SpeedUp:
                        player.FramerateUp();
                        App.Current.EventsBroker.Publish <PlaybackRateChangedEvent> (
                            new PlaybackRateChangedEvent {
                            Value = (float)player.Rate
                        }
                            );
                        return;

                    case KeyAction.SpeedDown:
                        player.FramerateDown();
                        App.Current.EventsBroker.Publish <PlaybackRateChangedEvent> (
                            new PlaybackRateChangedEvent {
                            Value = (float)player.Rate
                        }
                            );
                        return;

                    case KeyAction.CloseEvent:
                        App.Current.EventsBroker.Publish <LoadEventEvent> (new LoadEventEvent());
                        return;

                    case KeyAction.Prev:
                        player.Previous();
                        return;

                    case KeyAction.Next:
                        player.Next();
                        return;

                    case KeyAction.SpeedUpper:
                        player.FramerateUpper();
                        return;

                    case KeyAction.SpeedLower:
                        player.FramerateLower();
                        return;
                    }
                }
            }
        }
Ejemplo n.º 11
0
 public void TestTextboxCreation(KeyPressedEvent @e)
 {
     if (Keyboard.GetState().IsKeyDown(Keys.L))
     {
     }
 }
Ejemplo n.º 12
0
        private void OnKeyPressed(IKeyboard keyboard, Key key, int keyCode)
        {
            var keyPressedEvent = new KeyPressedEvent(keyCode, AXInputCodeMapper.SilkKeyToAXKey(key), 0);

            EventCallback(keyPressedEvent);
        }
    void OnKeyPressed(KeyPressedEvent a_event)
    {
        if (uiRelatedStuff.xySaved && !uiRelatedStuff.levelNameIF.isFocused)
        {
            switch (a_event.PressedKeyCode.ToString())
            {
            case "Alpha1":
            case "Keypad1":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[0].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[0].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[0].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[0].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[0].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha2":
            case "Keypad2":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[1].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[1].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[1].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[1].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[1].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha3":
            case "Keypad3":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[2].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[2].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[2].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[2].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[2].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha4":
            case "Keypad4":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[3].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[3].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[3].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[3].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[3].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha5":
            case "Keypad5":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[4].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[4].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[4].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[4].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[4].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha6":
            case "Keypad6":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[5].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[5].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[5].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[5].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[5].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha7":
            case "Keypad7":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[6].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[6].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[6].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[6].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[6].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha8":
            case "Keypad8":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[7].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[7].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[7].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[7].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[7].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha9":
            case "Keypad9":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[8].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[8].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[8].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[8].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[8].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Alpha0":
            case "KeypadDivide":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[9].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[9].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[9].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[9].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[9].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Minus":
            case "KeypadMultiply":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[10].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[10].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[10].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[10].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[10].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;

            case "Equals":
            case "KeypadMinus":
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    UITiles[11].GetComponent <Image>().sprite = swapSprite;
                    tileSwapper.ToSwap(UITiles[11].transform.GetChild(0).gameObject);
                }
                else
                {
                    UITiles[11].GetComponent <Image>().sprite = placeSprite;
                    tilePlacer.selectedTile       = UITiles[11].transform.GetChild(0).gameObject;
                    tilePlacer.selectedTileSprite = UITiles[11].transform.GetChild(0).gameObject.GetComponent <Image>().sprite;
                }
                break;
            }
        }
    }
Ejemplo n.º 14
0
        public void DashboardKeyListener(KeyPressedEvent e)
        {
            KeyAction       action;
            DashboardButton button;

            if (openedProject == null)
            {
                return;
            }

            try {
                action = App.Current.Config.Hotkeys.ActionsHotkeys.GetKeyByValue(e.Key);
            } catch {
                return;
            }

            //if (action == KeyAction.LocalPlayer || action == KeyAction.VisitorPlayer) {
            //	if (inPlayerTagging) {
            //		TagPlayer ();
            //	}
            //	if (pendingButton != null) {
            //		analysisWindow.ClickButton (pendingButton);
            //	}
            //	inPlayerTagging = true;
            //	taggedTeam = action == KeyAction.LocalPlayer ? TeamType.LOCAL : TeamType.VISITOR;
            //	playerNumber = "";
            //	analysisWindow.TagTeam (taggedTeam);
            //	timer.Change (TIMEOUT_MS, 0);
            //} else if (action == KeyAction.None) {
            //	if (pendingButton != null) {
            //		Tag tag = pendingButton.AnalysisEventType.Tags.FirstOrDefault (t => t.HotKey == e.Key);
            //		if (tag != null) {
            //			analysisWindow.ClickButton (pendingButton, tag);
            //			timer.Change (TIMEOUT_MS, 0);
            //		}
            //	} else if (dashboardHotkeys.TryGetValue (e.Key, out button)) {
            //		if (inPlayerTagging) {
            //			TagPlayer ();
            //		}
            //		if (button is AnalysisEventButton) {
            //			AnalysisEventButton evButton = button as AnalysisEventButton;
            //			/* Finish tagging for the pending button */
            //			if (pendingButton != null) {
            //				analysisWindow.ClickButton (pendingButton);
            //			}
            //			if (evButton.AnalysisEventType.Tags.Count == 0) {
            //				analysisWindow.ClickButton (button);
            //			} else {
            //				pendingButton = evButton;
            //				timer.Change (TIMEOUT_MS, 0);
            //			}
            //		} else {
            //			analysisWindow.ClickButton (button);
            //		}
            //	} else if (inPlayerTagging) {
            //		int number;
            //		string name = App.Current.Keyboard.NameFromKeyval ((uint)e.Key.Key);
            //		if (name.StartsWith ("KP_")) {
            //			name = name.Replace ("KP_", "");
            //		}
            //		if (int.TryParse (name, out number)) {
            //			playerNumber += number.ToString ();
            //			timer.Change (TIMEOUT_MS, 0);
            //		}
            //		return;
            //	}
            //}
        }
Ejemplo n.º 15
0
        void HandleKeyPressed(KeyPressedEvent e)
        {
            KeyAction action;

            try {
                action = App.Current.Config.Hotkeys.ActionsHotkeys.GetKeyByValue (e.Key);
            } catch (Exception ex) {
                /* The dictionary contains 2 equal values for different keys */
                Log.Exception (ex);
                return;
            }

            if (action == KeyAction.None) {
                return;
            }

            switch (action) {
            case KeyAction.FrameUp:
            case KeyAction.FrameDown:
                CameraObject camera = camerasTimeline.SelectedCamera;
                if (camera != null) {
                    Pause ();
                    Time before = secCamPlayerVM.CurrentTime;
                    if (action == KeyAction.FrameUp)
                        secCamPlayerVM.SeekToNextFrame ();
                    else
                        secCamPlayerVM.SeekToPreviousFrame ();
                    Time diff = secCamPlayerVM.CurrentTime - before;

                    // Reflect change in offset
                    camera.MediaFile.Offset += diff.MSeconds;
                    UpdateLabels ();
                    // TODO: Reflect the change in the timeline position without triggering a seek.
                }
                return;
            }
        }
Ejemplo n.º 16
0
        void HandleKeyPressed(KeyPressedEvent e)
        {
            KeyAction action;

            try {
                action = App.Current.Config.Hotkeys.ActionsHotkeys.GetKeyByValue (e.Key);
            } catch (Exception ex) {
                /* The dictionary contains 2 equal values for different keys */
                Log.Exception (ex);
                return;
            }

            if (action == KeyAction.None || loadedPlay == null) {
                return;
            }

            switch (action) {
            case KeyAction.EditEvent:
                bool playing = player.Playing;
                player.Pause ();
                App.Current.GUIToolkit.EditPlay (loadedPlay, openedProject, true, true, true, true);
                if (playing) {
                    player.Play ();
                }
                break;
            case KeyAction.DeleteEvent:
                App.Current.EventsBroker.Publish <EventsDeletedEvent> (
                    new EventsDeletedEvent {
                        TimelineEvents = new List<TimelineEvent> { loadedPlay }
                    }
                );
                break;
            }
        }
Ejemplo n.º 17
0
        public void UIKeyListener(KeyPressedEvent e)
        {
            KeyAction action;

            try {
                action = App.Current.Config.Hotkeys.ActionsHotkeys.GetKeyByValue (e.Key);
            } catch (Exception ex) {
                /* The dictionary contains 2 equal values for different keys */
                Log.Exception (ex);
                return;
            }

            if (action != KeyAction.None) {

                if (analysisWindow != null) {
                    switch (action) {
                    case KeyAction.ZoomIn:
                        analysisWindow.ZoomIn ();
                        return;
                    case KeyAction.ZoomOut:
                        analysisWindow.ZoomOut ();
                        return;
                    case KeyAction.ShowDashboard:
                        analysisWindow.ShowDashboard ();
                        return;
                    case KeyAction.ShowTimeline:
                        analysisWindow.ShowTimeline ();
                        return;
                    case KeyAction.ShowPositions:
                        analysisWindow.ShowZonalTags ();
                        return;
                    case KeyAction.FitTimeline:
                        analysisWindow.FitTimeline ();
                        return;
                    }
                }

                if (projectType == ProjectType.CaptureProject ||
                    projectType == ProjectType.FakeCaptureProject ||
                    projectType == ProjectType.URICaptureProject) {
                    switch (action) {
                    case KeyAction.PauseClock:
                        if (capturer.Capturing) {
                            capturer.PausePeriod ();
                        } else {
                            capturer.ResumePeriod ();
                        }
                        break;
                    case KeyAction.StartPeriod:
                        capturer.StartPeriod ();
                        break;
                    case KeyAction.StopPeriod:
                        capturer.StopPeriod ();
                        break;
                    }
                } else {
                    switch (action) {
                    case KeyAction.FrameUp:
                        player.SeekToNextFrame ();
                        return;
                    case KeyAction.FrameDown:
                        player.SeekToPreviousFrame ();
                        return;
                    case KeyAction.JumpUp:
                        player.StepForward ();
                        return;
                    case KeyAction.JumpDown:
                        player.StepBackward ();
                        return;
                    case KeyAction.DrawFrame:
                        player.DrawFrame ();
                        return;
                    case KeyAction.TogglePlay:
                        player.TogglePlay ();
                        return;
                    case KeyAction.SpeedUp:
                        player.FramerateUp ();
                        App.Current.EventsBroker.Publish<PlaybackRateChangedEvent> (
                            new PlaybackRateChangedEvent {
                                Value = (float)player.Rate
                            }
                        );
                        return;
                    case KeyAction.SpeedDown:
                        player.FramerateDown ();
                        App.Current.EventsBroker.Publish<PlaybackRateChangedEvent> (
                            new PlaybackRateChangedEvent {
                                Value = (float)player.Rate
                            }
                        );
                        return;
                    case KeyAction.CloseEvent:
                        App.Current.EventsBroker.Publish<LoadEventEvent> (new LoadEventEvent ());
                        return;
                    case KeyAction.Prev:
                        player.Previous ();
                        return;
                    case KeyAction.Next:
                        player.Next ();
                        return;
                    case KeyAction.SpeedUpper:
                        player.FramerateUpper ();
                        return;
                    case KeyAction.SpeedLower:
                        player.FramerateLower ();
                        return;
                    }
                }
            }
        }