Checked for isKeyWindow before processing keyboard input. Fixed include paths.