I had a similar issue where some keys like shift and the windows key clicks stop working. I was able to fix it by going into the settings and turning on compatibility mode and running as administrator. I don't know which one fixed it, but here is what i did.
1: Open files
2: Go to "this pc" and choose Windows-SSD
3: Open program files (x86)
4: Open Steam then steamapps
5: Open common
6: Find and open the Stardew Valley folder (The list should be in Alphabetical order)
7: Right click Stardew Valley (The one with the stardew valley chicken icon)
8: Open properties
9: Go to compatibility
10: Click run as administrator and run in compatibility mode for: (whichever you want, I don't think it matters but I choose windows 8)
11: Hit apply and ok
I hope this help because this was driving me mad, especially because it was so specific to which keys would make everything just stop.