I hit this issue multiple times, but in my case the only way to get back the keyboard key working was to exit and enter back in the game.
So far I did not figure it out any specific way to reproduce the issue. It happened to me with the accelerator, brake and left turn key.