I'm trying to make a program in C# that basically functions based on the key a user presses (ex. X = Quit, D = Disconnect, etc;) by using Console.ReadKey(); in c#

The problem I'm running into is how to use the ReadKey info in a Switch statement.. Can someone help please? The code is below.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Switch_Test
{
    class Program
    {
        static void Main()
        {
            Console.WriteLine("Welcome. Please enter your command: ");
            string chinput;
            int input;
            bool activated = false;
            input = Console.ReadKey();
            chinput = Convert.ToChar(input);
            switch (chinput)
            {
                case 'x':
                    {
                        Console.WriteLine("You pressed x...");
                        break;
                    }
                case 'y':
                    {
                        Console.WriteLine("You pressed y..");
                        break;
                    }
                case 'd':
                    {
                        if (activated != true)
                        {
                            Console.WriteLine("Please activate first!");
                            break;
                        }
                        else
                        {
                            Console.WriteLine("Active..");
                            break;
                        }
                    }
                case 'a':
                    {
                        if (activated != true)
                        {
                            activated = true;
                            Console.WriteLine("Activating..");
                            break;
                        }
                        else
                        {
                            activated = false;
                            Console.WriteLine("Deacti
Edit
Report