Jump to content
View in the app

A better way to browse. Learn more.

Mouse Sensitivity Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Program used to move mouse a set distance?

Featured Replies

  • Replies 6
  • Views 7.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • DPI Wizard
    DPI Wizard

    Sorry, that was just the code snippet, and not the entire script For keyboards this is the entire script: function OnEvent(event, arg) if (event == "G_PRESSED" and arg == 1) and GetMKeyState

  • Wizard

Hi mate!

To emulate mouse movement I mainly use Logitech's scripting through their G-series LUA API. This can be used with any Logitech G series mouse or keyboard with G-keys. The script can be something like this:

if (event == "G_PRESSED" and arg == 1) and GetMKeyState() == 1 then
	for i = 0, 799 do
		MoveMouseRelative(10,0)
		Sleep(10)
	end
end

This will make the G1 button on the keyboard execute the code when also the M1 button is selected.

The script will send 800 (0-799) packets to the operating system with a 10 ms delay between each. And each packet tells the OS to move the mouse 10 counts on the X+ axis (to the right). So in totalt the mouse will move 8000 counts to to right.

I also use a Teensy USB board which can emulate a mouse. This is doing the exact same thing with a slightly different scripting language, but this device is emulating the mouse movement exactly like mouse hardware before sending it through the USB port, while the Logitech solution emulates it in software on the computer. In some cases using the Teensy might be advantageous because it fires less processes on the computer.

In most cases though, using the Logitech solution works perfectly fine.

I also have a machine that physically moves the mouse with 0.1 mm accuracy that I use to test equipment and verify that the theory matches the fact.

19 hours ago, DPI Wizard said:

Hi mate!

To emulate mouse movement I mainly use Logitech's scripting through their G-series LUA API. This can be used with any Logitech G series mouse or keyboard with G-keys. The script can be something like this:


if (event == "G_PRESSED" and arg == 1) and GetMKeyState() == 1 then
	for i = 0, 799 do
		MoveMouseRelative(10,0)
		Sleep(10)
	end
end

This will make the G1 button on the keyboard execute the code when also the M1 button is selected.

The script will send 800 (0-799) packets to the operating system with a 10 ms delay between each. And each packet tells the OS to move the mouse 10 counts on the X+ axis (to the right). So in totalt the mouse will move 8000 keyboard, to to right.

I also use a Teensy USB board which can emulate a mouse. This is doing the exact same thing with a slightly different scripting language, but this device is emulating the mouse movement exactly like mouse hardware before sending it through the USB port, while the Logitech solution emulates it in software on the computer. In some cases using the Teensy might be advantageous because it fires less processes on the computer.

In most cases though, using the Logitech solution works perfectly fine.

I also have a machine that physically moves the mouse with 0.1 mm accuracy that I use to test equipment and verify that the theory matches the fact.

5

I try the script, nothing move

I try to change a key by changing 

arg == 1 

to the number of the G key,  still nothing work

can u explain why, please :) btw i don't have Logitech keyboard, I have G600 mouse

this is what is the code

if (event == "G_PRESSED" and arg == 11) and GetMKeyState() == 1 then

 

Edited by Sngop

  • Wizard

Sorry, that was just the code snippet, and not the entire script :)

For keyboards this is the entire script:

function OnEvent(event, arg)
	if (event == "G_PRESSED" and arg == 1) and GetMKeyState() == 1 then
		for i = 0, 99 do
			MoveMouseRelative(10,0)
			Sleep(10)
		end
	end
end

And for a mouse, use this (assigning to button 5):

function OnEvent(event, arg)
	if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then
		for i = 0, 99 do
			MoveMouseRelative(10,0)
			Sleep(10)
		end
	end
end

The G keys on the mouse are targeted like this, and not with the G_PRESSED syntax.

  • 2 years later...

Hello, I experimented with a similar script and CS:GO doesn't like it :cccc

360DistanceScript.lua

 

Edit:

I fixed it, it automatically switched to profile to the game I played for, which ment that I played on a profile without the script enabled. Huge thanks anyway for this post!

Edited by Fluffy Kalasjnikov

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.