Try checking for the condition

If i = "1" then

since the keypressed from the pc is a printable ascii character.

Jerson