Ctrl G + Spacebar = V

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
darkjoeomega
Posts: 1
Joined: 22 Jul 2018, 09:06

Ctrl G + Spacebar = V

22 Jul 2018, 09:10

Hi,

Can someone walk me through how to make on my keyboard:

"Ctrl + Spacebar" the letter "V"?

Note: For the function to work properly in the software, the ctrl button must be held down followed by pushing the spacebar.

Joe
mshafer1
Posts: 54
Joined: 16 Jul 2017, 14:49
Contact:

Re: Ctrl G + Spacebar = V

22 Jul 2018, 13:25

I'm not sure if your asking for CTRL + G + Space = v, or CTRL + Space = v, but if it is the latter - then here is a sample of code that works.

https://www.ahkgen.com/?length=1&commen ... tion0=Send

If asking for CTRL + G + Space = v . . .
I'm not really sure how to do that (personally) since ^g & Space is an invalid hotkey for some reason.
Maybe use ^g to enable a spacebar hotkey that sends v, and a ^g Up to disable the spacebar hotkey - something like (untested):
https://www.ahkgen.com/?length=3&commen ... tion2=Send

(turns out this will throw errors about not have a hotkey by that name, and https://www.ahkgen.com/?length=3&commen ... tion2=Send Doesn't work (although I'm not sure why) - do some of the more veteran writers want to chime in? Now I'ld like to know what a proper solution for this is too.
gregster
Posts: 9054
Joined: 30 Sep 2013, 06:48

Re: Ctrl G + Spacebar = V

22 Jul 2018, 14:51

As the docs state:
Combinations of three or more keys are not supported.
https://autohotkey.com/docs/Hotkeys.htm#combo (The 'custom combinations' section in this link shows some attempts using #If and GetKeyState to get around these limitations) and
Modifiers: Unlike a normal hotkey, custom combinations act as though they have the wildcard (*) modifier by default. For example, 1 & 2:: will activate even if Ctrl or Alt is held down when 1 and 2 are pressed, whereas ^1:: would be activated only by Ctrl+1 and not Ctrl+Alt+1.
That's why ^g & Space won't work. All modifiers will work anyway, here, in a two-key combo.

I think there is also a user defined class by Helgef named Longhotkey or similar, which might or might not help... not sure how it handles modifiers. Edit: here it is - https://autohotkey.com/boards/viewtopic.php?f=6&t=24145

Edit2:
Btw, many keyboards have problems with specific combos of three or more keys (which combos will work or not, depends on the keyboard model) because of technical limitations of the electrical circuit layout.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 235 guests