C# Класс ThoNohT.NohBoard.Hooking.MouseState

A class representing the current state of the mouse. I.e. which buttons are pressed, what is the current location, movement and scroll state.
Показать файл Открыть проект

Открытые методы

Метод Описание
AddPressedElement ( MouseKeyCode keyCode ) : void

Adds the specified mouse keycode to the list of pressed keys.

AddScrollDirection ( MouseScrollKeyCode keyCode ) : void

Adds the specified scroll direction to the list of scroll keys. Resets its timer if it is already pressed.

CheckKeys ( ) : void

Checks the state of all keys and removes the ones that are no longer pressed from the list of pressed keys.

CheckScrollAndMovement ( ) : void

Checks the scroll keys and movement. Call this method to remove the scroll buttons from state after they have been added. Also adds zero movement items to the history to return the movement counter to 0 gradually.

RegisterLocation ( Point location, int time ) : void

Registers a new location for the mouse.

RemovePressedElement ( MouseKeyCode keyCode ) : void

Removes the specified keycode from the list of pressed keys.

SetMouseFromCenter ( bool activate ) : void

Sets a value indicating whether to calculate the mouse speed from the center or not.

This method also recalculates the screen centers. So if a screen is added or removed while NohBoard is running, calling this method with true will re-calculate the new screen locations.

Приватные методы

Метод Описание
GetScreenCenterForPoint ( Point point ) : Point?

Gets the coordinates of the center of the screen that contains point.

The screen centers are pre-calculated whenever SetMouseFromCenter is set to true.

GetSpeed ( Point target, Point source, int dt ) : SizeF

Calculates the speed given two points and a time difference.

KeyIsUp ( MouseKeyCode key ) : bool

Checks whether the specified key is up.

Описание методов

AddPressedElement() публичный статический Метод

Adds the specified mouse keycode to the list of pressed keys.
public static AddPressedElement ( MouseKeyCode keyCode ) : void
keyCode MouseKeyCode The keycode to add.
Результат void

AddScrollDirection() публичный статический Метод

Adds the specified scroll direction to the list of scroll keys. Resets its timer if it is already pressed.
public static AddScrollDirection ( MouseScrollKeyCode keyCode ) : void
keyCode MouseScrollKeyCode The keycode of the scroll direction.
Результат void

CheckKeys() публичный статический Метод

Checks the state of all keys and removes the ones that are no longer pressed from the list of pressed keys.
public static CheckKeys ( ) : void
Результат void

CheckScrollAndMovement() публичный статический Метод

Checks the scroll keys and movement. Call this method to remove the scroll buttons from state after they have been added. Also adds zero movement items to the history to return the movement counter to 0 gradually.
public static CheckScrollAndMovement ( ) : void
Результат void

RegisterLocation() публичный статический Метод

Registers a new location for the mouse.
public static RegisterLocation ( Point location, int time ) : void
location Point The new location.
time int The time at which the location was registered.
Результат void

RemovePressedElement() публичный статический Метод

Removes the specified keycode from the list of pressed keys.
public static RemovePressedElement ( MouseKeyCode keyCode ) : void
keyCode MouseKeyCode The keycode to remove.
Результат void

SetMouseFromCenter() публичный статический Метод

Sets a value indicating whether to calculate the mouse speed from the center or not.
This method also recalculates the screen centers. So if a screen is added or removed while NohBoard is running, calling this method with true will re-calculate the new screen locations.
public static SetMouseFromCenter ( bool activate ) : void
activate bool True if distance should be caculated relative to the screen center, /// false if distance should be calculated relative to the previous mouse position.
Результат void