Note: This article was translated with the assistance of AI. I wrote the original in Chinese. If you can read Chinese, you are welcome to read the original Chinese version for the most authentic and unfiltered expression.

Preface

Zotero is an open-source, free research literature management tool with a rich plugin ecosystem that makes it very convenient for academic work. However, there’s one thing that really bothered me as a user: when navigating within a document—for example, clicking the table of contents or references—I often need to jump back. But the only way to go back is to click the back button at the top with the mouse. Unlike browsers and other software, you can’t use the mouse side buttons to go back.

Inspired by a fellow netizen, I wrote a simple script with AHK to map the mouse side button to the back shortcut. For me, it’s been incredibly handy.

I won’t go into the details of how to use Zotero or AutoHotkey here—please refer to the relevant documentation if you’re not familiar with them.

Code

1
2
3
4
5
6
#Requires AutoHotkey v2.0

#HotIf WinActive("ahk_exe zotero.exe")
XButton1::Send "{AltDown}{Left}{AltUp}"
XButton2::Send "{AltDown}{Right}{AltUp}"
#HotIf

On Windows, if you want this script to run at startup, simply place the .ahk script file in the shell:startup directory.