Spacebar Hotkey

I know this is possible… I just don’t know how.

I want to use the spacebar as a hotkey for my Play/Pause button in my iTunes remote control app (TuneConnect, http://tuneconnect.mattpat.net). This isn’t possible by directly specifying the hotkey in Interface Builder. Any ideas?

-Matt

I think you can do it programatically:

set key equivalent of button x of window y to space

It works :smiley:

The only problem is that since my interface only has one text field in it, after the user enters text, the hotkey stops working (because the field assumes the spacebar is meant for it). Being the only selectable control, there is no way to “leave” the text field… the cursor just stays there, even when you click somewhere else in the window. Any suggestions?

-Matt

There is an “on changed” event for text fields, I think, or similar, where you can check if last character is a space… Unless “space” is a legal character in your text field…

Unfortunately, it is… I wish that there was some way to just get focus to leave the text box…

-Matt