Portable approach to disable special lock-key behavior