ah, that is annoying (re SDL bug). and yeah, I'd prefer it to use the key my keymap has as escape unless it's rebindable to that in which case the default doesn't really matter
I think a good rule of thumb for when to use which is to see whether you are using the key for its location (e.g. wasd for movement) in which case it should use the scancode or its semantic meaning (e.g. enter for accept) in which case you should see what the key mapping is. to me at least escape for menu is more a case of the key being used because of its meaning rather than where it is located on the keyboard