I use Ukelele to make a custom keyboard layout. In most (non-Apple) programs this works fine (iTerm, Sublime Text, Adium). In Mail and Calendar it is currently not working, although I believe it worked in the past. Selecting the input source doesn't do anything and leaves the previous one ticked. Both 10.9 and 10.11 seem to have this issue. I've tried deleting the cache:
sudo rm /System/Library/Caches/com.apple.IntlDataCache* sudo rm /var/folders/*/*/-Caches-/com.apple.IntlDataCache*
This did not help. Is there any reason for Mail (or Apple apps) not to accept custom keyboard layouts?