Actually, if you really need to type Spanish accent marks on a regular basis, then the best thing to do is relax, take a deep breath, and install a Spanish keyboard layout on your computer.
But perhaps you just need to type some words now and then, and you do not want to wrestle with your system configuration (or simply cannot). Then I have two different solutions for you: