lastfm/lastfm-desktop — pull request #31 by wroberts (2013-03-12 16:58:28+00:00)
Title: Raise/Hide Last.fm checkbox does not work in Advanced Settings

The Raise/Hide checkbox in the Advanced pane of the application Preferences is checked and disabled. This checkbox should enable or disable the function of the system-wide hotkey which raises the Last.fm Scrobbler client window to front.

There is a Last.fm forum entry complaining about the hotkey keyboard shortcut here:

* [Last.fm forum bug report: Unable to change Keyboard shortcuts](http://www.last.fm/forum/34905/_/2199781)

Implementing the raise/hide checkbox functionality should make some of these people less grumpy.

Here's how the hotkey is implemented in the current codebase:

* [Location of HotKey installation: lastfm-desktop/app/client/Application.cpp](https://github.com/lastfm/lastfm-desktop/blob/fc664d1b2da8e8777525e03798b3d0e1444ebe2e/app/client/Application.cpp#L308)
* [Underlying implementation in: lastfm-desktop/lib/unicorn/UnicornApplication.cpp](https://github.com/lastfm/lastfm-desktop/blob/fc664d1b2da8e8777525e03798b3d0e1444ebe2e/lib/unicorn/UnicornApplication.cpp#L405)

Some useful links for how to implement system-wide HotKeys (Mac OS X-specific):

* [Cocoa Tips and Tricks: How to add a HotKey Listener](http://cocoatutorial.grapewave.com/tag/hotkey/)
* [Mac virtual key-codes](http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes)

This pull request contains a few changes which hopefully will get this checkbox button working in the UI. **Warning:** I have not been able to test this commit. Can anyone confirm that this code works?

PS: [Issue #30](https://github.com/lastfm/lastfm-desktop/issues/30) is a duplicate of this pull request. Sorry.