Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to make an AutoHotkey script for making Ctrl+Space toggle the space bar's function. The default function is space. When Ctrl+Space is pressed, the function changes to em space. Search em space if you don't know it. When Ctrl+Space is pressed anew, it goes back to space. Can anyone help me?

share|improve this question
    
Have you tried anything ? –  Lamb May 11 '13 at 14:15
    
I have two scripts right now. One has a code that changes the space bar's function to em space. The other doesn't have that code. –  Michael Dy May 11 '13 at 14:23
    
So, you are having problem with the toggling part ? –  Lamb May 11 '13 at 14:26
    
Yes............ –  Michael Dy May 11 '13 at 14:29
    
Can you provide the script you are using ? –  Lamb May 11 '13 at 14:34
show 1 more comment

1 Answer

up vote 0 down vote accepted

Use this script, Ctrl+Space will "Toggle" the space key's Mode.

IsEmSpaceOff := true

^Space:: 
if(IsEmSpaceOff)
IsEmSpaceOff := false
else
IsEmSpaceOff := true
return

#if !IsEmSpaceOff
Space::SendInput { }
share|improve this answer
    
It works, but when I restart my PC, the default is em space. I tried understanding your code, but to no end. How can you make space the default? –  Michael Dy May 12 '13 at 3:50
    
You mean that after restarting the PC and running the script again you get "EM space" as default ? But I'm not having this issue at mine. Is it the case that you want em space to be the 'Default action' of Space Bar ? I can't understand your issue. –  Lamb May 12 '13 at 7:03
    
After restarting my PC, I get em space by default. I want space to be the default, not em space. –  Michael Dy May 12 '13 at 14:53
    
Are you sure there is no other script interfering ? Because I also tried it and I am not having the same problem. Script has default set to Normal Space, so that should not be a problem. Check for any other auto-running. –  Lamb May 12 '13 at 15:00
    
I fixed it. There's nothing wrong with your code. Thanks for the code. –  Michael Dy May 12 '13 at 15:49
show 1 more 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.