Console.ReadKey() binds to Consolekeyinfo
Well im just trying to create some keybindings and save them down in a .json file.. everything works out great but somehow no matter what key i press to test it out it binds it to System.ConsoleKeyInfo instead of a real key press
![](https://utfs.io/f/9d1658ab-4b53-45d0-b779-43bd8d11f5a7-4pl4mu.png)
![](https://utfs.io/f/aaff1b3d-0e11-48ac-bb59-6019ab24d45c-4pl4mu.png)
18 Replies
Can you show the
Keybindings
class?![](https://utfs.io/f/06ef7b26-8d3c-4e8f-b365-f4e3d9014c90-4pl4mu.png)
thinker227#5176
REPL Result: Success
Result: string
Compile: 430.771ms | Execution: 20.343ms | React with ❌ to remove this embed.
Ah, a key info doesn't have a ToString override
ohh.. so what should i do to fix this 😄
![](https://utfs.io/f/3718d2b6-5f71-4517-9149-3db27d6158e3-4pl4mu.png)
or does it not work? 😄
switching up string with var works.. but i cant switch string to var in here...
![](https://utfs.io/f/3e8de076-01c7-4c58-8f54-f017239129b7-4pl4mu.png)
Wdym?
switching string into var here works..
![](https://utfs.io/f/93a15f5c-70bb-4252-8b59-af00a189ce22-4pl4mu.png)
![](https://utfs.io/f/01998145-e785-4ea8-9959-96dbabf45d89-4pl4mu.png)
he doesnt say anything then.. but then this not work xD
![](https://utfs.io/f/64b2bfe9-5bf7-410e-a571-8db775c1aa19-4pl4mu.png)
![](https://utfs.io/f/949288e2-fbb8-44e6-b811-7ee471ed457b-4pl4mu.png)
or idk.. im pretty much idealess 😄 need help :3
I think you should do
Console.ReadKey().Key.ToString()
That returns the name of the key as a stringthinker227#5176
REPL Result: Success
Result: string
Compile: 429.654ms | Execution: 30.809ms | React with ❌ to remove this embed.
As opposed to just
Console.ReadKey().ToString()
which doesn't return anything usefulworks :3 tyty 😄