private void Form1_KeyDown(object sender, KeyEventArgs e) { S.KeyPress((char)e.KeyValue); if ((int)e.KeyValue == 27) { S.Deselect(); } if ((int)e.KeyValue == 46) { S.DeleteCurrentSquare(); } pictureBox1.Invalidate(); }