Jump to content

I'm having trouble trying to get what I want for a macro to work. What I am wanting to happen is whenever I click my left mouse button, after that it should press the 2 key twice in a quick succession. My logitech software doesn't allow me to remap the left mouse, just only switch it to right mouse.

 

I hope what i'm wanting is clear enough

the sky is up

Link to comment
https://linustechtips.com/topic/1027328-mouse-macro-help/
Share on other sites

Link to post
Share on other sites

You can use AutoHotKey to do this.

Not exactly sure what you're asking, but I think this would kinda accomplish what you're asking:

;When the Left mouse button is pressed
if GetKeyState("LButton")
	{
		;Click the left mouse button, at the current position (it is possible to tell it to click at a certain spot on your screen)
		Send {Click}
        ;Click the left mouse button once again
		Send {Click}
	}

;Lines that start with a semicolon (like this line), are just notes and are not run in the program. They can be deleted, but are added for completion sake

Keep in mind some games see AHK as a cheat software.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
https://linustechtips.com/topic/1027328-mouse-macro-help/#findComment-12244969
Share on other sites

Link to post
Share on other sites

5 minutes ago, Minibois said:

 

Not exactly sure what you're asking, 

 

So i'm trying to do this for an FPS

Whenever I press LeftMouse to shoot, right after that it should press the 2 key a few moments after, and then press 2 key again.

I'll try the script and see what happens.

the sky is up

Link to comment
https://linustechtips.com/topic/1027328-mouse-macro-help/#findComment-12244994
Share on other sites

Link to post
Share on other sites

Just now, Richtofen The Hyena said:

So i'm trying to do this for an FPS

Whenever I press LeftMouse to shoot, right after that it should press the 2 key a few moments after, and then press 2 key again.

I'll try the script and see what happens.

The script I inserted in my previous post will not use the number 2 and I think will also ignore your mouse click (will intercept it I think).

What you want for that would be this:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

LButton::
		;Click the left mouse button, at the current position (it is possible to tell it to click at a certain spot on your screen)
		Send {Click}
		Send, {2}
		Send, {2}

This, when you press your left mouse button, will click the mouse at the current position and after that will press the '2' character twice in rapid succession. Again, especially online games will see this as a cheat.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
https://linustechtips.com/topic/1027328-mouse-macro-help/#findComment-12245030
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

×