system wide shortcut for Mac OS X

前端 未结 3 464
滥情空心
滥情空心 2020-12-10 09:27

So I was asked to port some internal helper applications to Mac OS X 10.7.

Works all quite welll as the platform dependent code is minimal anyhow, but one applicati

3条回答
  •  心在旅途
    2020-12-10 09:53

    Using the power of google, I found this snippet of code, which allows the registration of global hotkeys for Mac OS X

    You'll need to add the Carbon framework, and probably a bridged cast for ARC when passing the Objective-C self pointer to the C function.

    At a minimum, you'll also need to:

    #import 
    

    The keycodes can be seen on this page explaining the virtual key codes.

提交回复
热议问题