To my knowledge, no history plugin can detect which browser button exactly has been pressed.
The best you can do is keep a history of visited pages, then check if the new page is further back in the history than the current one. When pages are revisited without the back/forward button, you'll probably get wrong results with below code.
Untested example code:
var visitedPages = [$.address.path()];
var currentPage = $.address.path();
$.address.internalChange(function() {
visitedPages.push($.address.path());
});
$.address.externalChange(function() {
var newPage = $.address.path();
var currentPageIndex = -1;
var newPageIndex = -1;
for (var i = 0; i < visitedPages.length; i++) {
if (visitedPages[i] == currentPage) currentPageIndex = i;
if (visitedPages[i] == newPage) newPageIndex = i;
}
if (newPageIndex == -1 || currentPageIndex == -1) {
console.log("unkown button pressed");
} else {
if (newPageIndex > currentPageIndex) {
console.log('forward pressed');
} else
if (newPageIndex < currentPageIndex) {
console.log('back pressed');
} else {
console.log('page reloaded?');
}
}
});