Fix support for keyboard mode in non-Windows systems