overwolf.games.inputTracking API
Provides keyboard and mouse activity information while the user is in-game.
Methods Reference
- overwolf.games.inputTracking.getActivityInformation()
- overwolf.games.inputTracking.getMatchActivityInformation()
- overwolf.games.inputTracking.getMousePosition()
- overwolf.games.inputTracking.init()
Events Reference
- overwolf.games.inputTracking.onKeyUp
- overwolf.games.inputTracking.onKeyDown
- overwolf.games.inputTracking.onMouseUp
- overwolf.games.inputTracking.onMouseDown
- overwolf.games.inputTracking.onMouseWheel
Types Reference
- overwolf.games.inputTracking.InputActivity Object
- overwolf.games.inputTracking.MousePosition Object
- overwolf.games.inputTracking.GetActivityResult Object
- overwolf.games.inputTracking.GetMousePositionResult Object
- overwolf.games.inputTracking.KeyEvent Object
- overwolf.games.inputTracking.MouseEvent Object
getActivityInformation(callback)
Version added: 0.92
Returns input activity information.
| Parameter | Type | Description |
|---|---|---|
| callback | (Result:GetActivityResult) => void | Callback with input activity information |
Notes
- The information includes key presses and clicks for keyboard/mouse, total session time, idle time and overall actions-per-minute. This information resets between game executions.
- When a new game starts, we reset the entire session - when the game ends, the last activity information is available until the next game session.
- You have to play for 5 minutes and have at least 30 keys to be eligible.
getMatchActivityInformation(callback)
Version added: 0.92
Returns input activity information (similar to getActivityInformation()), however, when this is supported, it will return data only for the latest match of the current game.
This function is currently not working as expected. As a workaround, you can use getctivityInformation() and manually identify matches and calculate the deltas between them.
| Parameter | Type | Description |
|---|---|---|
| callback | (Result:GetActivityResult) => void | Callback with input activity information |
In order to get the information:
- The latest match must have lasted for more than 5 minutes.
- The user must have clicked more than 30 times on either keyboard or mouse.
getMousePosition(callback)
Version added: 0.93
Returns the last mouse position in game.
The data includes the mouse position and a boolean stating whether the click was in the game or on an Overwolf widget (onGame).
| Parameter | Type | Description |
|---|---|---|
| callback | (Result:GetMousePositionResult) => void | Callback with input activity information |
Note that you need to call init() before calling this function, OR, register to one of the events: onMouseUp, onMouseDown, onMouseWheel.
Otherwise, you will get an error:
{status: "error", reason: "Input tracking not initialized."}`
init(callback)
Version added: 0.160
For using getMousePosition without pre-register to events.
| Parameter | Type | Description |
|---|---|---|
| callback | (Result) => void | Returns with the result |