Handle keyboard layout variants properly.