You can do this without extra software by using Automator and the OS X Services functionality.
The Keyboard Viewer "app" lives at
/System/Library/Input Methods/KeyboardViewer.app (in versions prior to Lion, it may be at
/System/Library/Components/KeyboardViewer.component/Contents/SharedSupport/KeyboardViewerServer.app). You open it with a hotkey by using Automator to create a simple launcher service.
- Open Automator and select Service as the type of your new document.
- Set the options (at the top of the workflow area) to "Service receives no input in any application".
Add the Run Shell Script action to your workflow, and replace the text with the following lines:
killall KeyboardViewer open "/System/Library/Input Methods/KeyboardViewer.app"
- Save with a name like "Open Keyboard Viewer", then open Keyboard Preferences to the Keyboard Shortcuts tab. Select Services in the left pane and scroll to the bottom, where you should see the name of your Service under the General Section.
- Make sure the box is checked to enable it, then select it and click add shortcut to set a hotkey.
- After setting the hotkey, open the Services menu in any application (i.e. Finder > Services), then close it. For some reason my hot key didn't work until I did this.
A couple notes:
killall KeyboardViewerline is there because closing the Viewer window doesn't quit the process, so if you open it, close it, then try to open it again, it won't return to view. You first have to quit the process then open.
- The script is pretty dumb, so the KeyboardViewer process will remain open once you've launched it.
- If you're running a pre-Lion OS, replace that path with the one to
KeyboardViewerServer.app(check in Finder first), and replace