overwolf.games.inputTracking

Provides keyboard and mouse activity information while in game

Methods

getActivityInformation(callback)

Version added: 0.92.200

Returns the input activity information. The information includes presses for keyboard/mouse, total session time, idle time and actions-per-minute. This information resets between game executions.

  • Parameter: callback <function>

    A callback with the activity information.

Callback argument:
{
  "status": "success",
  "activity": {
    "mouse": {
      "total": 34,
      "dist": 18822,
      "keys": {
        "M_Right": 29,
        "M_Left": 5
      }
    },
    "keyboard": {
      "total": 0,
      "keys": {}
    },
    "aTime": 2.86,
    "iTime": 4.63,
    "apm": 12
  }
}

getMousePosition(callback)

Version added: 0.93.6.0

Returns the input last mouse position in game. the data includes the mouse position and a boolean stating whether the keypress was on a game or on an Overwolf widget (onGame)

  • Parameter: callback <function>

    A callback with the mouse position information

Callback argument:
{
    "status": "success",
    "mousePosition": {
        "x": 1741,
        "y": 656,
        "onGame": true,
        "handle": {
            "value": 526402
        }
    }
}

Events How to use events

onKeyUp

Version added: 0.78

Fired when a keyboard key has been released.

The event information includes the virtual key code (key) and a boolean stating whether the keypress was on a game or on an Overwolf widget (onGame)

Event value:
{
    "key": "81",
    "onGame": true
}

onKeyDown

Version added: 0.78

Fired when a keyboard key has been pressed.

Event value:
{
    "key": "81",
    "onGame": true
}

onMouseUp

Version added: 0.78

Fired when a mouse key has been released.

The event information includes whether the left or white mouse button was clicked (button), x and y coordinates (x, y) and a boolean stating whether the keypress was on a game or on an Overwolf widget (onGame)

Event value:
{
    "button": "none",
    "x": 1002,
    "y": 821,
    "onGame": false
}

onMouseDown

Version added: 0.78

Fired a mouse key has been pressed.

Event value:
{
    "button": "xbutton2",
    "x": 177,
    "y": 529,
    "onGame": true
}