I didn't understand the Alt Gr + 4 business, but here's a semi-useful tip that should work in both Windows and Linux systems. If you hold down the Alt Gr key and then type a vowel, you'll get the vowel with an accent over it. If you do this with the Caps Lock on, or in combination with the Shift key, you'll get an accented capital vowel. Thus [Alt Gr] + [o] should give you ó.
Doesn't seem to work with other letters, though!