I'd say bout 75% of ad-libbing that most people do on the keys come from scales, chord arpeggios, and chord inversions. Mainly, the major scale of whatever key you're in, and the arpeggio & chord inversions of the chord you're on.
The first thinkg you can do is, if you have to sit on a chord for a long period of time, start by playing the chord as is, then in the RH play each individual note of the chord in some kind of rhythmic fashion. Keep the LH still while you do this. Next, after you have played each individual note of the chord, switch to a different inversion (can be higher or lower depending on the sound you want) and do the same thing. Keep the process up until you need to change chords. For example:
[1] Db-Db / Ab-Db-F *here u have a Db major chord in 2nd inversion)
[an, 2, an] / Ab, Db, F *here, u arpeggiate the Db major chord
[3] / Db-Ab *here u switch to a Db major chord in root position
[an, 4, an] / Db(above the previous Ab), Ab, F *Db major chord arpeggiation
(repeat that a few times to get a feel for it)
The next thing you can do is create your own little melody lines. They can mimic the song, or they can be something you make up yourself. I like to do these little melody lines on top of my chords. Sometimes, you can do melody lines inside the chord, but that's up to you. Where do these melody lines come from? I'm glad you asked that. They should mainly come from the major scale of the key you are in. For example:
Db / Ab-Db-F
/ Gb, F, Eb, Db
C / C-Eb-Ab
/ Ab, Bb, C
Bb / Gb-Bb-Db
/ F, Gb, Ab, Db, C, Ab
Ab / Db-F-Ab
There really are no finger exercises that will get you good at this other than the proper fingering for major scales, specific chord inversions, etc. It all depends on how flexible ur fingers are. If you're the type of person that uses the same fingers for just about every chord (like my dad, lol), ad-libbing will be difficult. But, if you have trained ur fingers to do what you want them to do, it will be relatively easier.
In your practice time, try to develop fingering that not only helps you play the chord you're on, but sets you up for the next chord or at least anticipates any future chording ideas. For example:
/ Ab-C-Eb *use figners 1-3-4
/ Ab-Db-F *use fingers 1-3-5
If you really look at the fingerings I have for these 2 chords, the fingering for the first chord is a set up for the fingering on the next chord. Notice that on the Ab chord, ur 4th finger is playing the Eb. Using your 4th finger there gives you the ease of just dropping the 5th finger down on the F in the next chord w/out much movement in your hands. If you had used the 5th finger on the last note for both chords, there would be some unnecessary "hopping" going on. Now, try this:
/ Ab-C-Eb *use figners 1-2-3
/ Ab-Db-F *use fingers 1-3-5
/ Bb-Db-Gb *use fingers 1-2-4
Ahhh, we've added a chord here. Now, look at the fingering for the 1st 2 chords. These are the same chords we played ealier, but the fingering for the first chord is a little different. Why? What happened? Well, here I'm anticipating the last chord, the Gb major chord. So, in order to be smooth, I had to change up my fingerings for the 1st chord to accomodate the future chords.
I know this seems hard, but the more you practice, the more stuff like this will just become natural, and you wan't even think about it. You will just do it.