I lost interest too, once I reached my endgame, and got that satisfaction - took me 2 years to build the next iteration
Keyboards are truly insignificant in the grand scheme of things, even for work/coding, you don't need the optimal keyboard, any keyboard does the job, it's a hobby, a useful one compared to unuseful hobbies
But for regular work - and for life, catastrophic events like you described could seriously ruin you, I used to call the phenomenon "time slips" - It's like you enter an auto pilot mode, and lose months, sometimes years, without you even realise that you've been going on aimlessly
Back when I was developing Facebook apps, Facebook used to remove apps, or take action against them, suddenly and without a cause or justification, you would pour your life into something, and they'd obliterate it as they wished - it was brutal, every time this happened, I entered one of these time slips, at the time I was at college, I went on for 1-2 months without doing any additional work, I'd continue with school, but in a very numb manner, I was going on, but slipping through time
Anyway, long story short, if you want to prevent these "time slips" - It's better to regulate your work and habits artificially, force yourself to do certain things no matter what happens in life (a minimal amount of work, research, whatever - a basic workout routine for your body) - this way you recover fast, and even if you don't recover, you at least achieve things while you are slipping through time