First, don't fuck around with possibly RSI type things, you can make a temprorary irritation into a permanent disability that way. Possibly consult experts
and definitely go read some anatomy texts and figure out what exactly hurts and and see if you can figure out why.
I've got psoriasis and associated arthritis symptoms have taken a lot of my dexterity from me the past year. Its a bitch; I am my hands in the way that dogs are their nose. I get internal join pains from elbows down, associated with finger movement, and sometimes cramps or weakness in particular muscles or groups that make some motions just not happen. Opening a bottle cap is pretty sure to cost pain and require a moment straightening that hand back out, now.
I can't say I'm managing it well. I push through the pain, try to retain patience as I drop things and have to find workarounds and new ways to do things i once found easy. I try to be sensitive to becoming irritable with others socially because ive been typing too much today or whatever, and not do that. It's not easy.
I've known this time was likely coming; early on I did things like acquiring a stack of Model M keyboards, learning some keyboard technique from old high typing rate secretaries and piano players (wrists up!), and adopting an index finger trackballs instead of mice (MS Explorer Trackballs; or Elecom M-HT1UR). That worked for my body and habits. Whatever makes your body comfortable while you're fiddling the small switches in a static position for long periods of time will vary. The "long periods" makes the "comfortable during" bit very, very important.