Global Hot Key
-
Hi there,
I'm looking for a way to catch a global hotkey - specifically a
function key. The Carbon routine I've seen used requires a modifer key
to be used but I'd prefer an unmodifier Fx key. After looking through
the archives I can't see any obvious way to do it. I'm using
NDHotKeyEvent now so please don't point me there. :) I'm starting to
think they're reserved for the UI server or something. The
Accessibility Inspector does it though so I'm hoping there's a
published API for it somewhere. I've looked at the source for an older
version of the Accessibility Inspector but it's using the Carbon
routine and does require a modifer so I'm back to square one. Any
ideas?
Thanks,
Guy -
On 10 May 2005, at 06:49, Guy English wrote:
> I'm looking for a way to catch a global hotkey - specifically a
> function key. The Carbon routine I've seen used requires a modifer key
> to be used but I'd prefer an unmodifier Fx key. After looking through
> the archives I can't see any obvious way to do it. I'm using
> NDHotKeyEvent now so please don't point me there. :) I'm starting to
> think they're reserved for the UI server or something. The
> Accessibility Inspector does it though so I'm hoping there's a
> published API for it somewhere. I've looked at the source for an older
> version of the Accessibility Inspector but it's using the Carbon
> routine and does require a modifer so I'm back to square one. Any
> ideas?
Unfortunately, one of the rule of using Carbon is that Apple doesn't
document it very well so you need to look in the header file:
* inHotKeyModifiers:
* The keyboard modifiers to look for. On Mac OS X 10.2 or
* earlier, this parameter must be non-zero, i.e. there must be a
* modifier specified. On Mac OS X 10.3 or later, you may pass
* zero.
David Dunham A Sharp <david...>
Voice/Fax: 206 783 7404 http://a-sharp.com
Efficiency is intelligent laziness. -
Give me a couple of days and I will update NDHotKeyEvent so it does
not need a modifier key, I need this change myself for my program
Popup Dock.
On 11/05/2005, at 2:23 AM, David Dunham wrote:
>> I'm looking for a way to catch a global hotkey - specifically a
>> function key. The Carbon routine I've seen used requires a modifer
>> key
>> to be used but I'd prefer an unmodifier Fx key. After looking through
>> the archives I can't see any obvious way to do it. I'm using
>> NDHotKeyEvent now so please don't point me there. :) I'm starting to
>> think they're reserved for the UI server or something. The
>> Accessibility Inspector does it though so I'm hoping there's a
>> published API for it somewhere. I've looked at the source for an
>> older
>> version of the Accessibility Inspector but it's using the Carbon
>> routine and does require a modifer so I'm back to square one. Any
>> ideas?
>>
>
> Unfortunately, one of the rule of using Carbon is that Apple
> doesn't document it very well so you need to look in the header file:
>
> * inHotKeyModifiers:
> * The keyboard modifiers to look for. On Mac OS X 10.2 or
> * earlier, this parameter must be non-zero, i.e. there must be a
> * modifier specified. On Mac OS X 10.3 or later, you may pass
> * zero.
>
Nathan Day
<nathan_day...>
http://homepage.mac.com/nathan_day/ -
Hi guys,
Well thanks for that - I have no idea why I didn't think to look at
the header files. Oops. I've filed a bug against the documentation -
mostly 'cause it makes me feel better. :) Anyway I pass zero now and
it works as expected. Thanks for the pointer.
Nathan - I've modified your code already, it's really a trivial
change. I'll send you a zip file with the changed file it you'd like.
Thanks again,
Guy
On 5/10/05, Nathan Day <nathan_day...> wrote:
> Give me a couple of days and I will update NDHotKeyEvent so it does
> not need a modifier key, I need this change myself for my program
> Popup Dock.
>
> On 11/05/2005, at 2:23 AM, David Dunham wrote:
>
>>> I'm looking for a way to catch a global hotkey - specifically a
>>> function key. The Carbon routine I've seen used requires a modifer
>>> key
>>> to be used but I'd prefer an unmodifier Fx key. After looking through
>>> the archives I can't see any obvious way to do it. I'm using
>>> NDHotKeyEvent now so please don't point me there. :) I'm starting to
>>> think they're reserved for the UI server or something. The
>>> Accessibility Inspector does it though so I'm hoping there's a
>>> published API for it somewhere. I've looked at the source for an
>>> older
>>> version of the Accessibility Inspector but it's using the Carbon
>>> routine and does require a modifer so I'm back to square one. Any
>>> ideas?
>>>
>>
>> Unfortunately, one of the rule of using Carbon is that Apple
>> doesn't document it very well so you need to look in the header file:
>>
>> * inHotKeyModifiers:
>> * The keyboard modifiers to look for. On Mac OS X 10.2 or
>> * earlier, this parameter must be non-zero, i.e. there must be a
>> * modifier specified. On Mac OS X 10.3 or later, you may pass
>> * zero.
>>
>
> Nathan Day
> <nathan_day...>
> http://homepage.mac.com/nathan_day/
>
> _______________________________________________
> MacOSX-dev mailing list
> <MacOSX-dev...>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
-
That would be great thanks.
On Wednesday, May 11, 2005, at 10:19AM, Guy English <guy.english...> wrote:
> Hi guys,
>
> Well thanks for that - I have no idea why I didn't think to look at
> the header files. Oops. I've filed a bug against the documentation -
> mostly 'cause it makes me feel better. :) Anyway I pass zero now and
> it works as expected. Thanks for the pointer.
>
> Nathan - I've modified your code already, it's really a trivial
> change. I'll send you a zip file with the changed file it you'd like.
>
> Thanks again,
> Guy
>
>
> On 5/10/05, Nathan Day <nathan_day...> wrote:
>> Give me a couple of days and I will update NDHotKeyEvent so it does
>> not need a modifier key, I need this change myself for my program
>> Popup Dock.
>>
>> On 11/05/2005, at 2:23 AM, David Dunham wrote:
>>
>>>> I'm looking for a way to catch a global hotkey - specifically a
>>>> function key. The Carbon routine I've seen used requires a modifer
>>>> key
>>>> to be used but I'd prefer an unmodifier Fx key. After looking through
>>>> the archives I can't see any obvious way to do it. I'm using
>>>> NDHotKeyEvent now so please don't point me there. :) I'm starting to
>>>> think they're reserved for the UI server or something. The
>>>> Accessibility Inspector does it though so I'm hoping there's a
>>>> published API for it somewhere. I've looked at the source for an
>>>> older
>>>> version of the Accessibility Inspector but it's using the Carbon
>>>> routine and does require a modifer so I'm back to square one. Any
>>>> ideas?
>>>>
>>>
>>> Unfortunately, one of the rule of using Carbon is that Apple
>>> doesn't document it very well so you need to look in the header file:
>>>
>>> * inHotKeyModifiers:
>>> * The keyboard modifiers to look for. On Mac OS X 10.2 or
>>> * earlier, this parameter must be non-zero, i.e. there must be a
>>> * modifier specified. On Mac OS X 10.3 or later, you may pass
>>> * zero.
>>>
>>
>> Nathan Day
>> <nathan_day...>
>> http://homepage.mac.com/nathan_day/
>>
>> _______________________________________________
>> MacOSX-dev mailing list
>> <MacOSX-dev...>
>> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>>
> _______________________________________________
> MacOSX-dev mailing list
> <MacOSX-dev...>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
>
Nathan Day
<nathan_day...>
http://homepage.mac.com/nathan_day/



