I just got a Logitech Marble mouse and also had the problem of scrolling. So I have made this script on AutoHotKey. The left Xbutton enables scrolling, meaning that while down you can scroll vertically and horizontally with the ball, and move forward and backwards in the browser with the left and right buttons. The right Xbutton has the same action as the middle button.
Im on windows 7.
#SINGLEINSTANCE FORCE
GLOBAL status := "basic"
GLOBAL cnt_x
GLOBAL cnt_y
XButton2::MButton
$*XButton1::
status := "scroll"
cnt_x := 0
cnt_y := 0
MOUSEGETPOS, st_x, st_y
SETTIMER, _scroll, 30
RETURN
$*XButton1 UP::
status := "basic"
SETTIMER, _scroll, OFF
RETURN
_scroll:
MOUSEGETPOS, cur_x, cur_y
MOUSEMOVE, st_x, st_y
IF(abs(cur_x-st_x) > abs(cur_y-st_y)) {
cnt_x := cnt_x + (cur_x-st_x)
ControlGetFocus, control, A
IF (cnt_x > 7) {
cnt := floor(cnt_x / 8)
LOOP, %cnt% {
SendMessage, 0x114, 0, 0, %control%, A
}
cnt_x := cnt_x - 8*floor(cnt_x / 8)
} ELSE IF (cnt_x < -7) {
cnt := -ceil(cnt_x / 8)
LOOP, %cnt% {
SendMessage, 0x114, 1, 0, %control%, A
}
cnt_x := cnt_x - 8*ceil(cnt_x / 8)
}
} ELSE {
IF (cur_y >= st_y) {
cnt_y := cnt_y + (cur_y-st_y)**1.2
} ELSE {
cnt_y := cnt_y -(st_y-cur_y)**1.2
}
IF (cnt_y > 7) {
cnt := floor(cnt_y / 8)
LOOP, %cnt% {
CLICK WheelUp
}
cnt_y := cnt_y - 8*floor(cnt_y / 8)
} ELSE IF (cnt_y < -7) {
cnt := -ceil(cnt_y / 8)
LOOP, %cnt% {
CLICK WheelDown
}
cnt_y := cnt_y - 8*ceil(cnt_y / 8)
}
}
RETURN
$*LButton::
IF (status = "basic") {
CLICK DOWN Left
} ELSE IF (status = "scroll") {
SEND {Browser_Back}
}
RETURN
$*LButton UP::
IF (status = "basic") {
CLICK UP Left
}
RETURN
$*RButton::
IF (status = "basic") {
CLICK DOWN Right
} ELSE IF (status = "scroll") {
SEND {Browser_Forward}
}
RETURN
$*RButton UP::
IF (status = "basic") {
CLICK UP Right
}
RETURN