Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 28, 2005, 07:45 PM   #1
iBonzo
macrumors newbie
 
Join Date: Feb 2005
New Tutorial on Global Hotkeys

I wrote a tutorial on how to use Global Hotkeys in Cocoa. After much trouble finding documentation on this area of Cocoa, I wrote this tutorial to explain it simply.

Link: http://www.dbachrach.com/blog/2005/1...oa-easily.html

Hope it helps ya'll.

-Dustin
iBonzo is offline   0 Reply With Quote
Old Nov 29, 2005, 01:59 PM   #2
whooleytoo
macrumors 603
 
whooleytoo's Avatar
 
Join Date: Aug 2002
Location: Cork, Ireland.
Send a message via AIM to whooleytoo
Quote:
Originally Posted by iBonzo
I wrote a tutorial on how to use Global Hotkeys in Cocoa. After much trouble finding documentation on this area of Cocoa, I wrote this tutorial to explain it simply.

Link: http://www.dbachrach.com/blog/2005/1...oa-easily.html

Hope it helps ya'll.

-Dustin
Haven't tried it yet, but looks very interesting. Thanks for the tutorial!
__________________
Mac <- Macintosh <- McIntosh apples <- John McIntosh <- McIntosh surname <- "Mac an toshach" <- "Son of the Chief"
whooleytoo is offline   0 Reply With Quote
Old Nov 29, 2005, 05:16 PM   #3
HiRez
macrumors 601
 
HiRez's Avatar
 
Join Date: Jan 2004
Location: Western US
Quote:
Originally Posted by iBonzo
I wrote a tutorial on how to use Global Hotkeys in Cocoa.
Very cool, thanks a lot iBonzo! I don't have a need for this now, but I probably will someday.

Now, I have a somewhat related question for you all. I'm trying to have it so that I have hotkeys specific to a document window. For example, the space bar would toggle a pause/play method (independant for each document window). OK, so I have subclassed NSWindow and overridden keyDown: and that works fine. However, the problem is that I have editable text fields on this window, and as soon as I begin to edit one of the text fields, I lose my "window hotkeys" because it's stuck editing the text field. The text field will not resign editing (or focus, responder) status when I'm done editing (with return key). So how can I tell my app, or that document window at least, to end all editing and "defocus" all UI objects? I found a few methods that looked like they might do that, but they didn't work as advertised. Do I have to do something painful like subclass every editable UI object to accomplish this?
HiRez is offline   0 Reply With Quote
Old Nov 29, 2005, 05:36 PM   #4
iBonzo
Thread Starter
macrumors newbie
 
Join Date: Feb 2005
I have not experimented with this, but as I was browsing through the docs, I think I came accross something that might work. I've just pulled it up right now in XCode and it looks like it might work. Open up your XCode and look at the Developer Documentation under Help. Do a search for "InstallEventHandler". This should bring up a page with explinations. Scroll down a little bit and read the Disccusion part. There is mention of InstallWindowEventHandler. Seems like it would be very similar to the turoial I wrote but just using a different function (InstallWindowEventHandler instead of InstallApplicationEventHandler) but do look into that function a little more to make sure.

Hope this helps,

-Dustin
iBonzo is offline   0 Reply With Quote
Old Nov 30, 2005, 03:13 AM   #5
HiRez
macrumors 601
 
HiRez's Avatar
 
Join Date: Jan 2004
Location: Western US
Quote:
Originally Posted by iBonzo
Hope this helps
Thanks, I will have a look at that.
HiRez is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
ATV needs hotkeys nelson1457 Apple TV and Home Theater 2 Mar 24, 2014 09:03 PM
Does VLC have global hotkeys? vmflapem MacBook Pro 1 Jan 11, 2014 10:51 PM
Numbers/Excel Hotkeys thechris.prince Mac Applications and Mac App Store 1 Apr 8, 2013 05:32 PM
copy paste hotkeys tedesco24 Mac Applications and Mac App Store 10 Jan 21, 2013 08:20 PM
VZW Galaxy S3 will have Global LTE! Will the iphone 5 have Global LTE also? PacificBeach iPhone 34 Jun 7, 2012 02:07 PM

Forum Jump

All times are GMT -5. The time now is 05:41 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC