user2318: A computer chess game does not permit moving the white King to d2 presumably because it's attacked by the black Knight which I suspect is correct, but the Knight can't actually attack that square because that would put it's King in check.
So, is the game correct?  Is Kd2 illegal?
[FEN "8/8/4k3/8/4n3/8/8/3KQ3 w - - 0 5"]


user2001: Nope. It is illegal to move your King to a threatened square. Also, please see this related question:
Bizarre pin rule: pinned pieces do not attack
Cheers!

user2698: It is possible not only for a pinned piece to block a king's motions, but also for a pinned piece to actively give check or even checkmate.  For example:
[FEN "r/6bb/8/n/1k/2N/P3QB/K6r w - - 0 0"]

1. Be1 Bxc3+ 2. Qb2+ Nb3++

White's bishop blocks the check, pinning itself.  Black's bishop pins itself when taking the knight, but simultaneously checks White.  Note that White's bishop is pinned, so it can't take Black's bishop.  White's Queen blocks check from the bishop, pinning itself, but also checking Black.  Because Black's bishop is pinned, Black cannot take White's queen (and although White's queen is pinned, it could take Black's bishop next turn and Black would not be able to re-take).  Black's knight, however, can deliver checkmate while blocking check and pinning itself in line with White's queen.  Note that White's pawn cannot take Black's knight because the knight's last move pinned it.

user2318: The FIDE Laws of Chess say:

3.8 There are two different ways of moving the king: by moving to any adjoining square not attacked by one or more of the opponent’s pieces
  ...  



3.9 The king is said to be 'in check' if it is attacked by one or more of the opponent's pieces, even if such pieces are constrained from
  moving to that square because they would then leave or place their own
  king in check. No piece can be moved that will either expose the king
  of the same colour to check or leave that king in check.


user291: Kd2 is indeed illegal. You can think of it this way: normally Black can't move his knight because White would "capture his king", but if White were able to play Kd2 then Black would capture White's king before White got a chance to capture his.

2318: <p>A computer chess game does not permit moving the white King to d2 presumably because it's attacked by the black Knight which I suspect is correct, but the Knight can't actually attack that square because that would put it's King in check.</p>

<p>So, is the game correct?  Is Kd2 illegal?</p>

<pre><code>[FEN "8/8/4k3/8/4n3/8/8/3KQ3 w - - 0 5"]
</code></pre>
 2001: <p>Nope. It is illegal to move your King to a threatened square. Also, please see this related question:</p>

<p><a href="https://chess.stackexchange.com/questions/1515/bizarre-pin-rule-pinned-pieces-do-not-attack">Bizarre pin rule: pinned pieces do not attack</a></p>

<p>Cheers!</p>
 2698: <p>It is possible not only for a pinned piece to block a king's motions, but also for a pinned piece to actively give check or even checkmate.  For example:</p>

<pre><code>[FEN "r/6bb/8/n/1k/2N/P3QB/K6r w - - 0 0"]

1. Be1 Bxc3+ 2. Qb2+ Nb3++
</code></pre>

<p>White's bishop blocks the check, pinning itself.  Black's bishop pins itself when taking the knight, but simultaneously checks White.  Note that White's bishop is pinned, so it can't take Black's bishop.  White's Queen blocks check from the bishop, pinning itself, but also checking Black.  Because Black's bishop is pinned, Black cannot take White's queen (and although White's queen is pinned, it could take Black's bishop next turn and Black would not be able to re-take).  Black's knight, however, can deliver checkmate while blocking check and pinning itself in line with White's queen.  Note that White's pawn cannot take Black's knight because the knight's last move pinned it.</p>
 2318: <p>The <a href="http://www.fide.com/component/handbook/?id=124&amp;view=article">FIDE Laws of Chess</a> say:</p>

<blockquote>
  <p>3.8 There are two different ways of moving the king: by moving to any adjoining square not attacked by one or more of the opponent’s pieces<br>
  ...  </p>
</blockquote>

<hr>

<blockquote>
  <p>3.9 The king is said to be 'in check' if it is attacked by one or more of the opponent's pieces, even if such pieces are constrained from
  moving to that square because they would then leave or place their own
  king in check. No piece can be moved that will either expose the king
  of the same colour to check or leave that king in check.</p>
</blockquote>
 291: <p>Kd2 is indeed illegal. You can think of it this way: normally Black can't move his knight because White would "capture his king", but if White were able to play Kd2 then Black would capture White's king before White got a chance to capture his.</p>
