Jump to content

Free Macro Keys utility

Go to solution Solved by userid,

You can use a single liner when only remapping one key to another, single one, just like we do with F6::^v. A single key is mapped to a single, other keyu (well, a combination in this case).

 

To execute more, you need to write an actual routine. Like so:

 

#NoEnv
#Persistent
#SingleInstance, Force

F6::
	Send, ^v{Enter}
	Return

If your use case requires a pause between the two, Add a Sleep instructions between keys. Like so:

 

Quote

#NoEnv
#Persistent
#SingleInstance, Force

F6::
Send, ^v

Sleep, xxx

Send, {Enter}
Return

Where xxx is the time you want the script to wait betweeen the two, in milliseconds.

Hi I want to make a paste command macro for one key on the keyboard.

CPU: Ryzen 2600 GPU: RX 6800 RAM: ddr4 3000Mhz 4x8GB  MOBO: MSI B450-A PRO Display: 4k120hz with freesync premium.

Link to comment
Share on other sites

Link to post
Share on other sites

What keyboard? If you have one with programmable macro keys, just set one to CTRL+V when you push it. OR you could use AHK and set up a key you never use (like the 10 key multiply) to push CTRL+V.

I'm not actually trying to be as grumpy as it seems.

I will find your mentions of Ikea or Gnome and I will /s post. 

Project Hot Box

CPU 13900k, Motherboard Gigabyte Aorus Elite AX, RAM CORSAIR Vengeance 4x16gb 5200 MHZ, GPU Zotac RTX 4090 Trinity OC, Case Fractal Pop Air XL, Storage Sabrent Rocket Q4 2tbCORSAIR Force Series MP510 1920GB NVMe, CORSAIR FORCE Series MP510 960GB NVMe, PSU CORSAIR HX1000i, Cooling Corsair XC8 CPU block, Bykski GPU block, 360mm and 280mm radiator, Displays Odyssey G9, LG 34UC98-W 34-Inch,Keyboard Mountain Everest Max, Mouse Mountain Makalu 67, Sound AT2035, Massdrop 6xx headphones, Go XLR 

Oppbevaring

CPU i9-9900k, Motherboard, ASUS Rog Maximus Code XI, RAM, 48GB Corsair Vengeance LPX 32GB 3200 mhz (2x16)+(2x8) GPUs Asus ROG Strix 2070 8gb, PNY 1080, Nvidia 1080, Case Mining Frame, 2x Storage Samsung 860 Evo 500 GB, PSU Corsair RM1000x and RM850x, Cooling Asus Rog Ryuo 240 with Noctua NF-12 fans

 

Why is the 5800x so hot?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 weeks later...

Install autohotkey. Create a text file and paste this code in there.

Then rename the file as name_you_like.ahk instead of .txt

If you want to have this script ready everytime your computer starts, type

> WindowsKey+R

> shell:startup

> press enter

 

A folder opens. Place the script inside. That's your statup folder. If the script is placed here, it will start everytime you log into your computer.

 

#NoEnv
#Persistent
#SingleInstance, Force

F10::^v

 

You can replace F10 as the trigger with anything you like.

useful resources here

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/9/2020 at 7:22 AM, JuliaAlphaDeltaEcho said:

Install autohotkey. Create a text file and paste this code in there.

Then rename the file as name_you_like.ahk instead of .txt

If you want to have this script ready everytime your computer starts, type

> WindowsKey+R

> shell:startup

> press enter

 

A folder opens. Place the script inside. That's your statup folder. If the script is placed here, it will start everytime you log into your computer.

 


#NoEnv
#Persistent
#SingleInstance, Force

F10::^v

 

You can replace F10 as the trigger with anything you like.

useful resources here

Worked! How do I create an exe to disable it?

CPU: Ryzen 2600 GPU: RX 6800 RAM: ddr4 3000Mhz 4x8GB  MOBO: MSI B450-A PRO Display: 4k120hz with freesync premium.

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, LOST TALE said:

Worked! How do I create an exe to disable it?

The easiest would be to add another hotkey to the script that simply terminates it.

For example, you could add another line with the following:

F11::ExitApp

Quite simple !

Link to comment
Share on other sites

Link to post
Share on other sites

If you'd rather want the option to toggle the F10 >> Paste hotkey on and off, without terminating the script entirely, try this:

 

#NoEnv
#Persistent
#SingleInstance, Force

; replace 1 with 0 if you want the hotkey to be off by default
hotkeyOn := 1

F10::
    if (hotkeyOn) {
        Send, ^v
    } else {
        Send, {F10}
    }
    Return

F12::
    if (hotkeyOn) {
        hotkeyOn := 0
    } else {
        hotkeyOn := 1
    }
    Return

This version of the script starts with the F10 >> Paste hotkey ON. Simply replacing the 1 on line 6 with a 0 will make it start being OFF.

 

The F12 key allows you to toggle the F10 between an ON and OFF state, and the script keeps running for later reactivation/use of the F10 hotkey.

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, JuliaAlphaDeltaEcho said:

If you'd rather want the option to toggle the F10 >> Paste hotkey on and off, without terminating the script entirely, try this:

 


#NoEnv
#Persistent
#SingleInstance, Force

; replace 1 with 0 if you want the hotkey to be off by default
hotkeyOn := 1

F10::
    if (hotkeyOn) {
        Send, ^v
    } else {
        Send, {F10}
    }
    Return

F12::
    if (hotkeyOn) {
        hotkeyOn := 0
    } else {
        hotkeyOn := 1
    }
    Return

This version of the script starts with the F10 >> Paste hotkey ON. Simply replacing the 1 on line 6 with a 0 will make it start being OFF.

 

The F12 key allows you to toggle the F10 between an ON and OFF state, and the script keeps running for later reactivation/use of the F10 hotkey.

The reason I want this is in case I need whatever key I choose for something else. this only moves the problem to F12 since F12 will forever do something other than F12, instead of F10 being in the same situation.

 

Can I just have a file that reads ''exitapp'' to close it?

CPU: Ryzen 2600 GPU: RX 6800 RAM: ddr4 3000Mhz 4x8GB  MOBO: MSI B450-A PRO Display: 4k120hz with freesync premium.

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, LOST TALE said:

The reason I want this is in case I need whatever key I choose for something else. this only moves the problem to F12 since F12 will forever do something other than F12, instead of F10 being in the same situation.

 

Can I just have a file that reads ''exitapp'' to close it?

 

I see, then here's how to do it.

The main script, still to be placed in shell:startup if you want it to start automatically. Let's say you name the file "myscript.ahk"

#NoEnv
#Persistent
#SingleInstance, Force

OnMessage("ciao", "closeScript")
Gui, Show
Return

F10::^v

closeScript() {
    Exitapp
}

 

And the termination script, that you save under another name, say on your desktop:

PostMessage, "ciao", , , , myscript.ahk

That second script only sends the message "ciao" to the first one (therefore the name at the end of the line, and the name of the first script have to match).

The first script listens for this message and exits when it receives it.

 

If you need the second script to be a .exe, right click on it and click on "compile script". AutoHotKey wil compile it into a .exe file that will appear in the same folder.

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/12/2020 at 12:12 PM, JuliaAlphaDeltaEcho said:

 

I see, then here's how to do it.

The main script, still to be placed in shell:startup if you want it to start automatically. Let's say you name the file "myscript.ahk"


#NoEnv
#Persistent
#SingleInstance, Force

OnMessage("ciao", "closeScript")
Gui, Show
Return

F10::^v

closeScript() {
    Exitapp
}

 

And the termination script, that you save under another name, say on your desktop:


PostMessage, "ciao", , , , myscript.ahk

That second script only sends the message "ciao" to the first one (therefore the name at the end of the line, and the name of the first script have to match).

The first script listens for this message and exits when it receives it.

 

If you need the second script to be a .exe, right click on it and click on "compile script". AutoHotKey wil compile it into a .exe file that will appear in the same folder.

 

The second script failed to stop the first one 

CPU: Ryzen 2600 GPU: RX 6800 RAM: ddr4 3000Mhz 4x8GB  MOBO: MSI B450-A PRO Display: 4k120hz with freesync premium.

Link to comment
Share on other sites

Link to post
Share on other sites

Works well after multiple tests on my side. Are you sure that the name you gave to the file containing the first script perfectly matches the name specified in the second script ?

For example:

First script is named: mainScript.ahk

Second script contains:

PostMessage, "ciao", , , , mainScript.ahk

 

Also just tried with the second script compiled as a .exe and the behavior is the same. Still works.

Check that names match (case sensitive) and tell me.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...
On 6/16/2020 at 8:32 AM, JuliaAlphaDeltaEcho said:

Works well after multiple tests on my side. Are you sure that the name you gave to the file containing the first script perfectly matches the name specified in the second script ?

For example:

First script is named: mainScript.ahk

Second script contains:


PostMessage, "ciao", , , , mainScript.ahk

 

Also just tried with the second script compiled as a .exe and the behavior is the same. Still works.

Check that names match (case sensitive) and tell me.

Hi, thanks for the help. I found how to close the utility from the quick toolbar or w.e

 

I wanted to ask: How do I add the ''enter'' key command after ^v? currently the code is:

 

#NoEnv
#Persistent
#SingleInstance, Force

F6::^v 

CPU: Ryzen 2600 GPU: RX 6800 RAM: ddr4 3000Mhz 4x8GB  MOBO: MSI B450-A PRO Display: 4k120hz with freesync premium.

Link to comment
Share on other sites

Link to post
Share on other sites

You can use a single liner when only remapping one key to another, single one, just like we do with F6::^v. A single key is mapped to a single, other keyu (well, a combination in this case).

 

To execute more, you need to write an actual routine. Like so:

 

#NoEnv
#Persistent
#SingleInstance, Force

F6::
	Send, ^v{Enter}
	Return

If your use case requires a pause between the two, Add a Sleep instructions between keys. Like so:

 

Quote

#NoEnv
#Persistent
#SingleInstance, Force

F6::
Send, ^v

Sleep, xxx

Send, {Enter}
Return

Where xxx is the time you want the script to wait betweeen the two, in milliseconds.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×