fixed key and focus events