Prevent double pressing while keeping constant pressing

Get help with using AutoHotkey and its commands and hotkeys
hiurt
Posts: 1
Joined: 17 Dec 2017, 19:13

Prevent double pressing while keeping constant pressing

17 Dec 2017, 19:44

When I press the space bar in my keyboard, sometimes it will input the space character twice. I got a script from AutoHotkey's subreddit that fixed my problem, though now nothing happens if I press the space bar constantly. The script is:


I have tried changing it to



It did fix it... kind of. When typing something, it now responds to constant pressing, but in games and in https://www.microsoft.com/appliedsciences/content/projects/KeyboardGhostingDemo.aspx, pressing the space bar (even if not constantly) does nothing unless ctrl or shift is being held. I honestly have no clue why this happens.

Is it possible to create a script that blocks double spaces while allowing pressing constantly (without having to press Ctrl or Shift too)? If so, what do I have to change/add/remove to the code above?

Thank you in advance!
Rohwedder
Posts: 673
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Prevent double pressing while keeping constant pressing

18 Dec 2017, 02:37

Hallo,
try:

Code: [Select all] [Download] GeSHi © Codebox Plus

$Space::
Send {Space Down}
Sleep, 100
SetKeyDelay,10,10
While GetKeyState("Space","P")
Send {Space Down}
Send {Space Up}
Return

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Helgef, looser447, Unknovvn and 67 guests