β CMD Causing Problems with Custom Input Class
I am working on a C# project that takes input from the user from CMD, and because I like my software to run a specific way I made my own Input Class. It adds a few things that the normal Console.ReadLine() does not include, like command histories and such. On Mac it runs perfectly, but I have not gotten it to work on windows because of a bothersome issue. With CMD while using the Console.ReadKey() and looping over it like this:
When you press backspace it moves the cursor over to the left one. I have noticed a few small issues like this, making getting CMD support difficult. My question is, is there a way to disable these shortcuts and just get the key input?
8 Replies
Console.ReadKey Method (System)
Obtains the next character or function key pressed by the user.
That is the function I am using, that is causing the weird backspace issue
it doesn't look like you're using it with the argument that suppresses the default key handling
The only argument that Im seeing on this page is the "intercept" argument and from the website it says this argument: "Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false".
yes
did you try it?
Yes sorry, There was a different bug that made it look like it didn't work
thank you for the help!
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.