Fast User Switching allows multiple users to switch quickly between accounts, but it can sometimes cause conflicts. Try disabling Fast User Switching to see if that resolves the issue.
Press Win + R to open the Run dialog.
Type "gpedit.msc" and press Enter to open the Local Group Policy Editor.
Navigate to "Computer Configuration" > "Administrative Templates" > "System" > "Logon."
Look for the setting "Hide entry points for Fast User Switching" on the right side and double-click it.
Select "Enabled" to disable Fast User Switching.
Click "Apply" and "OK."
You can create a new user profile on your computer and see if the issue persists in the new profile. If the keyboard works fine in the new profile, it may indicate that there's a problem with your existing user profile.