Closed brandobot closed 4 years ago
Interesting. Do you know of any solution to this? An environment variable maybe?
Did not find a resolution to this yet. We completed our project to re-issue the fv keys with the help of your code (thanks!!!) and were okay with a 5% failure rate due to different keyboard languages being used.
Finally took some time to look into this issue. I found that running the password prompt osascript command with "sudo" reverted my keyboard input to US.
Changing it to "USER_PASS="$(/bin/launchctl "$L_METHOD" "$L_ID" sudo -iu $CURRENT_USER /usr/bin/osascript -e 'display dialog "Please enter the password you use to log in to your Mac:" default answer "" with title "'"${PROMPT_TITLE//\"/\\"}"'" giving up after 86400 with text buttons {"OK"} default button 1 with hidden answer with icon file "'"${LOGO_POSIX//\"/\\"}"'"' -e 'return text returned of result')"" will retain the keyboard layout set by the user.
If a user is using a different keyboard input such as French or Spanish, the launchctl asuser method of invoking the password prompts will switch the user's keyboard to English.