In the game of 8-ball: suppose my opponent plays his/her shot without a foul, and the cue ball ends in a touching-ball situation (that is, the white ball stops right next to a ball, declared to be touching upon a close inspection). So now it is my turn to play, having been handed a touching ball situation, I see two scenarios:
The cue ball is in a touching situation with one of my own balls (say I had called stripes at the start of the game). Then I can call the touching ball to be my next shot, and it suffices to shoot the cue ball away from it, and it would count as if I had hit the called ball.
The cue ball is in a touching situation with one of my opponent's balls (solid color). Then by the same token, no matter what shot I call, shooting away would appear as if I had first hit my opponent's ball, because the cue ball was in touching with an opponent's ball. But that wouldn't make any sense, because I would then simply have no legal shots, and any play would be foul before me making any shot.
To remedy the 2nd scenario, I've been reading the rules again, and there's no bit that directly addresses this situation, namely, a touching situation where the two balls are the cue ball and one of opponent's ball. In one case, the rules say the following:
5.9 Touching Balls
If the cue ball is touching an object ball, the shooter must not play the cue ball in the direction of that ball. He is considered to have hit the touching ball when he shoots away from it if the ball is on for the shot.
But it does not specify, what if the touching ball is an opponent's ball, it seems to assume the touching ball is one of my own balls, hence the remark at the end "...if the ball is on for the shot." It can only be on for a shot if it is one of my own balls (stripes).
Another source suggests something somewhat orthogonal:
3.18 FAILURE TO CONTACT OBJECT BALL
It is a foul if on a stroke the cue ball fails to make contact with any legal object ball first. Playing away from a touching ball does not constitute having hit that ball.
How are such touching ball situations resolved? What legal shots do I have in case of 1. and 2.? Specially in case of 2., can I hit away from the touching ball even if the cue ball had been in touching/frozen situation with one of opponent's balls? It would be incredibly useful if you could also include a link to the rules with which you answer the question.