Computers && Coding == Art

PC Affinity [email protected]
Menu
  • Home
  • Downloads
  • Projects
  • About Me

Mouse Commands

Download latest version from Github

Resource to add mouse shortcuts to your .Net projects.

A simple mouse script.


The Mouse Commands project was another side-project from working on the Clipboard Cycler. While coding it, I decided to split up the Mouse features into an easy to use DLL file. Importing system dll’s, layouts, etc can be a painful process to research and implement. This DLL does it all for you.


To Use

Three simple steps.

  • Reference MouseCommands.dll in your project.
  • Create new instance of MouseCommands.
  • Set Action MouseActionEventCall (Returns MouseActionEvent and MousePoint)

Setup Example:

// Enter the using statement.
using MouseCommands;
using System;

namespace YourProgram
{
	static class Program
	{
		[STAThread]
		static void Main()
		{
			// Call new MouseCommand.
			MouseCommand mouse = new MouseCommand();
			// Setup Event Call (optional).
			mouse.MouseActionEventCall += OnMouseActionEventCall;
			// Do an action.
			mouse._MoveCursorPosition(new MousePoint(10, 10), 50);
			// Do another action.
			mouse._DoubleClick();
		}

		private void OnMouseActionEventCall(MouseActionEvent result, MousePoint pos)
		{
			//do something on Mouse _Actions.
		}
	}
}

Other Options:

//Returns a MousePoint type with X and Y locations of the mouse.
mouse.SetHotkeysGlobally = true;

//Default single left click at current mouse position.
//Can set Left, Middle, or Right clicks with the Click count and mouse position.
mouse._Click();

//Chaining commands is allowed.
Mouse._Click()._Click(); //etc...

//Default double left click at current mouse position.
//Can set Left, Middle, or Right clicks and mouse position.
mouse._DoubleClick();

//Specify a start position and end position with MousePoint types. Default click is Left.
//Can set Left, Middle, or Right clicks and the speed to move the mouse. (Higher is faster, 50 = default, speed = 0 is instant).
mouse._Drag();

//Specify a start position and end position with MousePoint types.
//Can set the speed to move the mouse. (Higher is faster, 50 = default, speed = 0 is instant).
mouse._MoveCursorPosition();

mouse.MouseActionEventCall is an event fired when a mouse event is fired from this resource.
It returns the type of action using the MouseActionEvent type, and the final mouse position in the MousePoint type.



Please feel free to view the source code over at GitHub. Completely available. Let me know if you have any questions or concerns. And please share with your friends!



Share this:

  • Twitter
  • Facebook
  • SMS
  • Email

Like this:

Like Loading...

Leave a Reply Cancel reply

My LinkedIn Profile


'Derrick Ducote'

Tags

API ASP.NET C# Clipboard Cycler Cloudflare Coding ColorFadeCalculator ConsoleWriter DLL Downloads First FMOL Assistant FMOL Marquee FP Time Tracker Gaming Hotkey Commands HTML Learning MagicHat MagicWheel Mouse Commands NGINX Other Personal PHP Picket Projects RegistryCommands RoundedButtons Server Site Information Synology Toolkit Cleanup

Categories

  • Apps
  • Coding
  • Configurations
  • Other
  • PHP
  • Server
  • Site Information

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

PC Affinity 2023 . Powered by WordPress

%d bloggers like this: