I am using Ukelele to create a Spanish keyboard layout. Its output consists of the regular English character set, plus these 16 special characters:
Vowels with acute accent: á é í ó ú Á É Í Ó Ú
U with dieresis: ü Ü
Eñe: ñ Ñ
Inverted punctuation marks: ¿ ¡
The existing Spanish keyboard on OS X uses various dead keys as accents, e.g. pressing ' followed by a produces á.
And the OS X approach of pressing and holding the letter to reveal all of its possible variations is a bit slow, and unfortunately does not work universally (some applications repeat the letter instead).
So, as a matter of personal preference, I would like to use the Option key to produce the special character associated with that letter. For example, Option-A to produce á, Option-N to produce ñ, etc. (I am fully aware of the historicity of ñ and that it is a distinct letter of the alphabet, and not simply an n with a diacritical mark. Option-N is still how I wish to type it. The reason is to preserve all of the non-alphabet keys of the keyboard with their existing printed labels, instead of reassigning one to ñ.)
However, I have run into a limitation with the letter U, which can take either an acute accent (ú) or a dieresis (ü). I want to cycle through these two possible outputs through repeated pressing of the U key while still holding down Option:
ú : Option-U (Press and hold Option, Press and release U, release Option)
Ú: Option-Shift-U (Press and hold Option, Press and hold Shift, Press and release U, release Shift, release Option)
ü: Option-U-U (Press and hold Option, Press and release U, Press and release U again, release Option)
Ü: Option-Shift-U-U (Press and hold Option, Press and hold Shift, Press and release U, Press and release U again, release Shift, release Option)
I have not found a way to do this, and reading other questions on this forum suggests that it might not be possible with a Keyboard Layout and that I would need to define an Input Method instead (something Ukelele is not designed to do).
I considered using Option-Command-U to make ü but then I can't define Option-Command-Shift-U to be Ü. Plus that could at most give me two accents per letter and I would like to extend this approach indefinitely, e.g. to create a French keyboard using the same paradigm:
é : Option-E
è : Option-E-E
ê : Option-E-E-E
ë : Option-E-E-E-E
This approach just feels more natural to me, even if it feels strange or non-standard to others.
Is this possible? Thank you for any suggestions!