0

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?

5
  • Have you tried anything ?
    – Ankit
    May 11, 2013 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, 2013 at 14:23
  • So, you are having problem with the toggling part ?
    – Ankit
    May 11, 2013 at 14:26
  • Can you provide the script you are using ?
    – Ankit
    May 11, 2013 at 14:34
  • *Space:: { SendInput { } } return
    – Michael Dy
    May 11, 2013 at 14:40

1 Answer 1

0

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 { }
6
  • 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, 2013 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.
    – Ankit
    May 12, 2013 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, 2013 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.
    – Ankit
    May 12, 2013 at 15:00
  • I fixed it. There's nothing wrong with your code. Thanks for the code.
    – Michael Dy
    May 12, 2013 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .