Show the Keyboard Viewer on Mac OS X 10.6.
Objective-C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
keyboardViewer.xcodeproj
Keyboard Viewer-Info.plist
Keyboard Viewer.icns
README.textile
main.m

README.textile

Suggested usage:

Download and install keyboardViewer:

sudo install keyboardViewer /usr/local/bin

Trigger with an AppleScript or shell script, e.g.:

tell application "System Events"
	if exists (process "Keyboard Viewer") then
		click process "Keyboard Viewer"'s window 1's buttons whose subrole is "AXCloseButton"
	else
		do shell script "/usr/local/bin/keyboardViewer"
	end if
end tell

The above will show Keyboard Viewer if it’s not running, and close it if it is.

I run the above script from FastScripts.

The keyboardViewer utility isn’t necessary on Mac OS X 10.5 because simply opening KeyboardViewerServer does the same thing.