press down and release Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Scripture

press down and release

18 Mar 2018, 15:38

Hello,

I have a function in a software in which I press down the space bar in order to insert a subtitle to a movie, then release it when it's time to sync the next subtitle.
I bought a small keypad in order to change all the commands to a smaller surface (instead of stupid lenovo yoga keyboard), but I can't move the space bar function
tried
Numpad0 :: Send {Space}
But it just keeps on speeding u through all the subtitles

Numpad0 :: Send {Space down}
just locks it down so the subtitle keeps on running after release of key

I already have a command for insert and exit with different buttons, but I really need one to replace the single space bar function

Thanks
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: press down and release

18 Mar 2018, 16:22

Give this a try:

Code: Select all

Numpad0::
    Send {Space Down}
    KeyWait, Numpad0
    Send, {Space Up}
return
HTH
Scripture

Re: press down and release  Topic is solved

18 Mar 2018, 17:34

Thank you, but the script doesn't seem to trigger anything
how critical is the position of each character? I copied it exactly how you posted
and then again by download, and afterwards moved some lines... but nada
what is the return used for?
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: press down and release

18 Mar 2018, 17:58

What i posted Pressing Numpad0 works the same as if it was the spacebar but without key repeating.

If you want to have the spacebar key repeat when Numpad0 is held you can do a simple remap of the key like so:

Code: Select all

Numpad0::Space
Note:
Numpad0::Space
does not need a return since its on the same line as the hotkey.

Return is used to close the hotkey on a multiple line hotkey subroutine (click return in the codebox to see the docs for it)


HTH
Scripture

Re: press down and release

18 Mar 2018, 18:46

Great!

the simple solution works,
guess I shouldn't have inserted the brackets in the first place :)

Thanks a lot

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, Darkmaster006, Google [Bot], ShatterCoder and 146 guests