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
18 Replies
Can you show the
Keybindings
class?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 😄
or does it not work? 😄
switching up string with var works.. but i cant switch string to var in here...
Wdym?
switching string into var here works..
he doesnt say anything then.. but then this not work xD
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 😄