It's the first time this has happened to me. Does anyone know why this could be happening? I think I configured something wrong in the keyboard settings.
This is working fine in Word 2011, for example.
It probably has something to do with the "Automatically switch to a document's input source" option in System Preferences -> Keyboard -> Input Sources, which allows you to have different output sources for different applications/tabs/documents. Simply uncheck that to only use one keyboard layout for all applications