To enable this:
- Go to System Preferences > Accessibility.
- In the categories along the left, select Keyboard.
- Select Enable Sticky Keys.
- Next to Enable Sticky Keys, click the Options... button.
- Select Display pressed keys on screen (and alternatively change where it appears). Click OK.