Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

What I would like to have is:

  1. By default the microphone should be muted
  2. When CapsLock is Down the microphone should unmute
  3. When CapsLock is Up the microphone should mute

(Basically convert my Skype to act like a Walkie-talkie with a push-to-talk functionality)

I found the AppleScript that can change the volume input of the microphone, so the first step was easy, but I didn't find any way to even assign the CapsLock to a script. Note that my CapsLock key is turned off and I would't like to sTART experiencing something like tHIS.

If the CapsLock is very special I wouldn't mind using another key, but I want to achieve the same functionality.

Edit: Probably it is not really possible to do it without using any application, so if there is an app that can do that, it would also work for me.

share|improve this question
    
Maybe this functionality could be added to the app/software you will use for recording. So, in which application you'll use it? –  nuc Apr 7 '11 at 11:09
    
@nuc Basically I want it to use it when I'm talking on Skype.. I want to use it as a walkie-talkie.. in order to talk you should press a button..! :) –  Lipis Apr 7 '11 at 13:56
add comment

2 Answers

up vote 4 down vote accepted
+100

First, the AppleScript that inspects the key state and handles the mic enabling and muting:

if (modKeyDowntest()) then
  tell application "System Events" to set volume input volume 100
  repeat while modKeyDowntest()
  end repeat
  tell application "System Events" to set volume input volume 0
end if

on modKeyDowntest()
  set modKeyDown to do shell script "~/opt/checkModifierKeys shift"
  set modKeyDown to modKeyDown as integer
  set modKeyDown to modKeyDown as boolean
end modKeyDowntest

Note, that

  • the script depends on the checkModifierKeys command line app (and it's path).
  • inspects the state of shift instead of caps lock (other possibilities are cmd, option, control and caps lock - caps lock, however, means the status of caps lock, not the key state!)

In the second step we bind the script to a key shortcut. There are many applications that can do this (some listed in an answer in SuperUser) or as an Automator service. (C&P from Lri's answer...)

One more option is to save the script as an Automator service:

  • Open Automator and choose the Service template.
  • Utilities — Run Shell Script / Run AppleScript.
  • Service receives [no input] in [any application].
  • Add the script to the text area and save.
  • Assign a shortcut in System Preferences — Keyboard — Keyboard Shortcuts — Services.

So, I assigned opt+shift+M to the script above and it enables the mic, keeping it unmuted as long as I hold shift. The mic is muted again when I release shift.

share|improve this answer
    
There might be some CLI app to inspect the key state of caps lock, so checkModifierKeys could very well be replaced to make the script act on caps lock. –  Jawa Apr 7 '11 at 11:31
1  
And for this question the mute status is the opposite as needed, so invert the volumes to get the right functionality. –  Jawa Apr 7 '11 at 11:32
    
Thanks for that.. I don't have time now to test all these things.. but basically what I want is to use Skype as a Walkie-talkie... hold a key to talk..! So I would prefer one key like F5 or something if the CapsLock is out of the question :) –  Lipis Apr 7 '11 at 13:59
    
Can you please update the answer to match the question as needed.. and I think that's the answer.. –  Lipis Apr 11 '11 at 12:07
1  
Updated. And thanks. :-) –  Jawa Apr 12 '11 at 12:40
add comment

I have not used it, but Skii plugin for Skype, seems to provide what you're looking for:

Skii is a very easy to use and simple plug-in that uses the Skype API to simplify the Push-to-Talk function. The app gives the user the possibility to control the Skype Push-To-Talk function with just one button! a small utility that will definetly improve your Skype user experience but also your overall workflow.

share|improve this answer
    
even though the other is more wide and thats is what I asked.. i think I have to go with the other one :) thanks for the Skii.. –  Lipis Apr 11 '11 at 12:05
1  
@lipis I would pick the other one as well :) –  nuc Apr 11 '11 at 12:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.