idk i reinstall, and 30 min ago i reinstall full steam and it back...Try verifying the integrity of game files, or just reinstall... If that doesn't fix it then I don't know what else to do.
What helped me is killing Xbox Game Bar (or something like it) and logging out/in my computer's user profile, and logging back in to Steam and re-launching Terraria.and now keyboard input is non-functional besides the rare overload that gets the button you want pressed to activate- used that to see if the controls were the same as always, and the controls were how they were supposed to be. Did a file verification, didn't fix it.