Added filtering for key codes.