It’s an extreme solution, but it certainly throws someone off your trail for a little bit.

When the library window opens, go to the Preferences folder and locate the file com.apple.HIToolbox.plist.

Select it and press Command-C to copy it.

Next, go to the Finder and navigate to the Macintosh HD > Library > Preferences folder.

Locate the same file in this directory and rename it to something like

com.apple.HIToolboix.plist-old

to make it a backup.

Then press Command-V to paste the copied file in this location.

Beyond the basics: advanced Mac keyboard tricks| Macworld