I am not entirely sure if this will continue to work, but I registered an account mainly so I could reply to your fix to thank you - I think this has solved my issue! I recently switched to an ANSI layout keyboard from ISO and even though I removed all other layouts it kept switching back.