An add-on called "Screencast Keys". The add-on can be enabled in Blender's user preferences. After it is enabled, you can access it at the bottom of the 3D viewport's properties panel (press N in the 3D viewport to show this panel).