Overwolf

Overwolf

  • Getting Started
  • Docs
  • API
  • Events Status
  • Blog
  • Q&A
  • Support

›overwolf.games

API Reference

  • Changelog
  • Overview

App Manifest

  • manifest.json
  • Validate your manifest

Available Game Events

  • Games IDs
  • Apex Legends
  • Call of Duty: Warzone
  • CS:GO
  • Dota 2
  • Final Fantasy XIV
  • Dota Underlords
  • Escape From Tarkov
  • Fortnite
  • Hearthstone
  • Heroes of the Storm
  • Legends of Runeterra
  • League of Legends
  • Minecraft
  • MTG Arena
  • Overwatch
  • Path of Exile
  • PUBG
  • PUBG Lite
  • Rainbow Six Siege
  • Rocket League
  • StarCraft II
  • Teamfight Tactics
  • Valorant
  • World of Tanks
  • World of Warcraft
  • World of Warships
  • Warframe
  • Various External APIs

Game Launchers Events

  • Launchers IDs
  • LOL Launcher

overwolf.benchmarking

  • overwolf.benchmarking

overwolf.campaigns

  • overwolf.campaigns.crossapp

overwolf.cryptography

  • overwolf.cryptography

overwolf.extensions

  • overwolf.extensions
  • overwolf.extensions.current
  • overwolf.extensions.sharedData
  • overwolf.extensions.io

overwolf.games

  • overwolf.games
  • overwolf.games.events
  • overwolf.games.inputTracking
  • overwolf.games.launchers
  • overwolf.games.launchers.events

overwolf.io

  • overwolf.io
  • overwolf.io.paths

overwolf.logitech

  • overwolf.logitech
  • overwolf.logitech.arx
  • overwolf.logitech.led

overwolf.media

  • overwolf.media
  • overwolf.media.audio
  • overwolf.media.replays
  • overwolf.media.videos
  • Highlights supported games

overwolf.os

  • overwolf.os
  • overwolf.os.tray

overwolf.profile

  • overwolf.profile
  • overwolf.profile.subscriptions

overwolf.settings

  • overwolf.settings
  • overwolf.settings.hotkeys
  • overwolf.settings.language
  • overwolf.settings.games

overwolf.social

  • overwolf.social
  • overwolf.social.reddit
  • overwolf.social.youtube
  • overwolf.social.discord
  • overwolf.social.gfycat
  • overwolf.social.twitter

overwolf.streaming

  • overwolf.streaming

overwolf.tobii

  • overwolf.tobii

overwolf.utils

  • overwolf.utils

overwolf.web

  • overwolf.web
  • overwolf.web.webserver
  • overwolf.web.websocket

overwolf.windows

  • overwolf.windows
Edit

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.

OBSOLETE

This function is obsolete. Instead, please use getMatchActivityInformation().

ParameterTypeDescription
callback(Result:GetActivityResult) => voidCallback 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.

ParameterTypeDescription
callback(Result:GetActivityResult) => voidCallback 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).

ParameterTypeDescription
callback(Result:GetMousePositionResult) => voidCallback 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.

ParameterTypeDescription
callback(Result) => voidReturns with the result

onKeyUp

Version added: 0.78

Fired when a keyboard key has been released, with the following structure: KeyEvent Object.

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

Using the onKeyUp event

We will use it to catch the user's keypress release, for example, catch the tab release:

overwolf.games.inputTracking.onKeyUp.addListener(function(info) {
    if(info.key == "9") //9=tab
        console.log("Tab key released: " + JSON.stringify(info));
});

onKeyDown

Version added: 0.78

Fired when a keyboard key has been pressed, with the following structure: KeyEvent Object.

Using the onKeyDown event

We can use it to catch the user's keypress, for example, catch the tab keypress:

overwolf.games.inputTracking.onKeyDown.addListener(function(info) {
    if(info.key == "9") //9=tab
        console.log("Tab key pressed: " + JSON.stringify(info));
});

The event also returns a boolean stating whether that keypress happened in the game or outside of it.

Note that it's not recommended to use this method (catching user keypresses) for hotkeys.
For that, use the overwolf.settings.hotkeys API.

onMouseUp

Version added: 0.78

Fired when a mouse key has been released, with the following structure: MouseEvent Object.

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

onMouseDown

Version added: 0.78

Fired when a mouse key has been pressed, with the following structure: MouseEvent Object.

onMouseWheel

Version added: 0.158

Fired when a mouse wheel has been used, with the following structure: WheelEvent Object.

InputActivity Object

ParameterTypeDescription
aTimenumber
iTimenumber
apmboolean
mouseobject{ total: number, dist: number, keys: any }
keyboardobject{ total: number, keys: any }

MousePosition Object

ParameterTypeDescription
xnumber
ynumber
onGameboolean
handleobject{ value: number }

GetActivityResult Object

ParameterTypeDescription
successboolean
errorstringnull if success is true
activityInputActivity objectthe input activity information

Example data: Success

{  
   "success":true,
   "activity":{  
      "mouse":{  
         "total":424,
         "dist":111176,
         "keys":{  
            "M_Right":413,
            "M_Left":11
         }
      },
      "keyboard":{  
         "total":83,
         "keys":{  
            "4":1,
            "Q":20,
            "W":20,
            "E":19,
            "R":10,
            "SPACE":4,
            "LCONTROL+TAB":2,
            "TAB":2,
            "ESCAPE":2,
            "LMENU+F4":1,
            "F":1,
            "OEM_3":1
         }
      },
      "aTime":4.36,
      "iTime":1.31,
      "apm":116
   }
}

GetMousePositionResult Object

ParameterTypeDescription
successboolean
errorstringnull if success is true
mousePositionMousePosition objectthe input activity information

Example data: Success

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

KeyEvent Object

ParameterTypeDescriptionNotes
keystring
onGameboolean

Event data example: Success

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

MouseEvent Object

ParameterTypeDescriptionNotes
buttonstring
xnumber
ynumber
onGameboolean

Event data example: Success

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

WheelEvent Object

ParameterTypeDescriptionNotes
deltanumber
xnumber
ynumber
onGameboolean

Event data example: Success

{
    "delta": "13",
    "x": 177,
    "y": 529,
    "onGame": true
}
Last updated on 2020-12-17 by eransharv
← overwolf.games.eventsoverwolf.games.launchers →
  • Methods Reference
  • Events Reference
  • Types Reference
  • getActivityInformation(callback)
  • getMatchActivityInformation(callback)
  • getMousePosition(callback)
  • init(callback)
  • onKeyUp
  • onKeyDown
  • onMouseUp
  • onMouseDown
  • onMouseWheel
  • InputActivity Object
  • MousePosition Object
  • GetActivityResult Object
  • GetMousePositionResult Object
  • KeyEvent Object
  • MouseEvent Object
  • WheelEvent Object
  • Legal
  • Terms overview
  • Developer's terms
  • App terms
  • Overwolf terms
  • Overwolf Privacy policy
  • Support
  • Questions and Answers
  • Discord
  • Slack
  • Facebook
  • Twitter
  • Documentation
  • Changelog
  • API
  • App Creation Process
  • Best Practices
  • Game Events status
  • Information
  • Careers
  • Fund
  • Developers Blog
  • Overwolf Appstore
  • Advertise on Overwolf