This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tryParseInput (info:ConsoleKeyInfo) = | |
match info.Key with | |
| ConsoleKey.LeftArrow -> Some (Action MoveLeft) | |
| ConsoleKey.RightArrow -> Some (Action MoveRight) | |
| ConsoleKey.UpArrow -> Some (Action MoveUp) | |
| ConsoleKey.DownArrow -> Some (Action MoveDown) | |
| ConsoleKey.NumPad7 | ConsoleKey.Home -> Some (Action MoveUpLeft) | |
| ConsoleKey.NumPad9 | ConsoleKey.PageUp -> Some (Action MoveUpRight) | |
| ConsoleKey.NumPad1 | ConsoleKey.End -> Some (Action MoveDownRight) | |
| ConsoleKey.NumPad3 | ConsoleKey.PageDown -> Some (Action MoveDownRight) | |
| ConsoleKey.NumPad5 | ConsoleKey.Spacebar | ConsoleKey.Clear -> Some (Action Wait) | |
| ConsoleKey.X -> Some Exit | |
| ConsoleKey.R -> Some (Action Restart) | |
| _ -> None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment