Skip to content

Release 0.2

Compare
Choose a tag to compare
@Empiree Empiree released this 06 Mar 12:20
· 304 commits to main since this release

0.2 Release available!

What's new:

  • Mouse Manipulator - a mouse control class.
  • Keyboard Manipulator - a keyboard control class.
  • Fixed minor bugs

Changelog:

KeyboardManipulator - a keyboard control class is created to emulate pressing buttons, as well as disabling them.

Methods:

  • Press - emulates pressing any key on the keyboard.:
keyboardManipulator.Press(Key.A);
  • Prevent - prohibits pressing the specified button:
keyboardManipulator.Prevent(Key.A);
  • Release - releases the button from the user ban using the 'Prevent' method:
keyboardManipulator.Release(Key.A);

You can also use the ReleaseAll() method:

keyboardManipulator.ReleaseAll();

Important! Locked buttons are shared among all KeyboardManipulator classes. You don't have to worry that an object in this class has locked a particular button and you no longer have access to that object.

For example:

var first = new KeyboardManipulator();
first.Prevent(Key.A);
            
var second = new KeyboardManipulator();
second.Prevent(Key.B);
            
first.LockedKeys // Key.A, Key.B
second.LockedKeys // Key.A, Key.B

Also, several events are available: KeyPrevented and KeyReleased. They are only triggered by a successful operation. For example, if a button is locked several times, the KeyPrevented event will be triggered only once.

Mouse Manipulator - a mouse control class.

Methods:

  • Click - presses a specified button at specified coordinates.
mouseManipulator.Click(500, 500, MouseButton.Left); // the left mouse button will be pressed at the coordinates: x: 500, y:500
  • Prevent / Release - are made similar to the Keyboard Manipulator