Found autohotkey (https://www.autohotkey.com/), a script-based app that captures keyboard and\or mouse clicks (haven't tried it yet though).
Unfortunately, it only runs on Windows.
Does anyone know a similar cross-platform tool? Or, at least, for Linux ?