I don't think that title probably helps very much, but here's my issue:

I'm using the awesome window manager and am trying to make my key bindings to be similar in flavor to OSX for special keys. I'm learning German, so I somewhat regularly need to type vowels with umlauts (double dots) above them. In OSX, to do this, you type Alt+U, then the vowel you want.

Obviously, that won't be feasible in awesome, but what I do want is modkey+ to send a keyboard event that gives it the impression I had hit an umlaut-ed key.

Would I have to change the keyboard layout first? Such that the code changes the layout, sends the corresponding event, then changes it back? Or can I send the event without changing the layout?

Afterwards you have to apply the content from this file with xmodmap ~/.Xmodmap

Another way to input umlauts is to use the us international layout. This allows you to enter umlauts with " + char. To enter ä you would need to enter "a. The international layout is also available in Windows and as far as i know in OSX.

However the window manager (specifically the Awesome WM) have a feature that it doesn't allow its keybindings to be intercepted by VirtualBox. I don't think that setxkbmap can help here.
–
Hi-AngelMar 6 at 12:26

In addition to the Compose key, you can also set up a key to select the so-called ‘third level’ by selecting one of the ‘international’ keyboard layouts. On Debian, I use ‘English (international AltGr dead keys)’. On PC keyboards, AltGr is actually meant for this purpose, and X likes to assign it to the third level shift by default. You can also do this explicitly.

All you need to make this work is hold down AltGr and press a key on the keyboard (it's basically another shift key). This is exactly the way this works on the Mac too.

Accents are more intuitively accessible than umlauts. AltGr+a issues á. The umlaut version uses a key near the vowel key on the keyboard:

AltGr+Q → ä

AltGr+R → ë (ok, not an umlaut; only listing it for completeness)

AltGr+J → ï (ditto)

AltGr+P → ö

AltGr+Y → ü

Press these with the Shift key down to get the upper case versions, e.g. AltGr+Shift+Q → Ä.