Why can't my king capture rook

I allowed rook to capture a knight thinking I could capture his rook with my king since my rook had his knight pinned to his king. Is there a rule I don't know about?

image
Read also:

Got into this position in a game. White to play.

image

I liked this win, I think I am improving slowly

image

Why does chess.com call this a draw when you could technically still mate in this position

image

Help me spot the mate that I missed during the game

image
197  
1 y

I made it actually funny rule

image
197  
1 y

R(ule)eal

image
197  
1 y

Get ruled on

image
197  
1 y

Rule

image
197  
1 y

eluR

image
197  
1 y

(Sonic fans do not) rule

image