Can't send the space key

Issue

I’m trying to fix double-typing on my keyboard.

For this I want to use an AutoHotkey (2) script like this:

SendMode "Input"
#SingleInstance

*g::
{
    Send "{g}"
    Sleep 50
}

Space::
{
    Send "{Space}"
    Sleep 50
}

The problem is that the "Space" key is not being sent at all. It does detect the key, because if I replace "Space" with "g", it sends g’s properly, but I’ve tried the following (ThisHotkey also returns "Space") and it’s still not being sent:

SendMode "Input"
#SingleInstance

*g::
{
    Send "{g}"
    Sleep 50
}

Space::
{
    Send ThisHotkey
    SendInput ThisHotkey
    
    Send "{Space}"
    Sleep 50
    Send "{Enter}"
    Sleep 50
    
    SendInput "{Space}"
    Sleep 50
    
    Send "{Space down}"
    Sleep 500
    Send "{Space up}"
    Sleep 500
    
    SendInput "{Space down}"
    Sleep 500
    SendInput "{Space up}"
    Sleep 500
}

"Enter" gets sent properly, for example. Am I overlooking something obvious? What can I do? Thank you.

Solution

SendMode "Input"
#SingleInstance

*g::
{
    Send "{g}"
    Sleep 50
}

~Space::    ;   ~ hotkey modifier
{
    Send "{Space 5}"
    Sleep 50
}

Source

Answered By – Dieisson Silva dos Santos

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published