If you have a keyboard with two Alt keys (e.g. a US Keyboard), you will find that PuTTY doesn’t recognize the one on the right side. It is a fatal problem if you are using Emacs in putty on Windows to editing files on a remote computer.

After doing some reasearching on it, I think there are two soluctions for this problem.

  1. Easily fixed the problem with a simple registry edit

    The putty topic Right Alt Key Broken shows an easy solution for it by add following registry code:

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] “Scancode Map”=hex:00,00,00,00,00,00,00,00,02,00,00,00,38,00,38,e0,00,00,00,00

  2. Use AutoHotkey to cheat Putty right Alt as left Alt

    Right click on AutoHotkey icon and click ‘Window Spy’ in the menu, you can get Putty class name in AutoHotkey. Then add following setting in current script in AutoHotkey:

    #IfWinActive ahk_class PuTTY RAlt::LAlt #IfWinActive

    Reload the script and you can use right Alt to invoke Emacs M-x key bindings in Putty.

I prefer the second way to fix the Right Alt Key Broken problem in Putty under Windows.