Many of bootcamp users (like me) are enjoying windows 8 gestures thanks to the Trackpad++ driver. However, in certain applications like Microsoft Office (Word, Excel, Powerpoint) the Horizontal Scrolling may not work as expected.
Here a workaround that has been really useful for me using autohotkey: ![]()
Ver 1.1
change log: Optimized and individualized settings for different office applications
Fix issue when multiple session of Excel are in execution
Scrolling for Adobe programs and some buggy explorer windows.
;Define Matching Method
SetTitleMatchMode, RegEx
ComObjError(false)
;For MS Office
#IfWinActive ahk_class (OpusApp)
WheelLeft::
WheelRight::
Acc_ObjectFromWindow(ActiveWinClassNN(), -16).SmallScroll(0,0,InStr(A_ThisHotkey,"Left")? -1:1)
return
#IfWinActive
#IfWinActive ahk_class (XLMAIN)
WheelLeft::
WheelRight::
ControlGet, hwnd, hwnd, , Excel71, ahk_class XLMAIN
Acc_ObjectFromWindow(hwnd, -16).SmallScroll(0,0,InStr(A_ThisHotkey,"Left")? -1:1)
return
#IfWinActive
;For MS PPT
#IfWinActive ahk_class (PPTFrameClass)
WheelLeft::ComObjActive("PowerPoint.Application").ActiveWindow.SmallScroll(0,0,0,1)
WheelRight::ComObjActive("PowerPoint.Application").ActiveWindow.SmallScroll(0,0,1)
#IfWinActive
;For Adobe Programs
#IfWinActive (Adobe)
CurrentWindows := ActiveWinClass()
WheelLeft:: ControlClick, ScrollBar1, %CurrentWindows%,, LEFT, 1, X0
WheelRight::
ControlGetPos, sx, sy, sw, sh, ScrollBar1, %CurrentWindows%
sw-=1 ;in order to be "inside"
ControlClick, ScrollBar1, %CurrentWindows%,, LEFT, 1, X%sw%
#IfWinActive
;For the buggy Windows Explorer - Scroll on the main frame.
#IfWinActive ahk_class CabinetWClass
WheelLeft:: ControlClick, ScrollBar1, ahk_class CabinetWClass,, LEFT, 1, X0
WheelRight::
ControlGetPos, sx, sy, sw, sh, ScrollBar1, ahk_class CabinetWClass
sw-=1 ;in order to be "inside"
ControlClick, ScrollBar1, ahk_class CabinetWClass,, LEFT, 1, X%sw%
#IfWinActive
; Sub Functions
Acc_Init()
{
Static h
If Not h
h:=DllCall("LoadLibrary","Str","oleacc","Ptr")
}
Acc_ObjectFromWindow(hWnd, idObject = -4)
{
Acc_Init()
If DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0
Return ComObjEnwrap(9,pacc,1)
}
ActiveWinClass()
{
WinGetClass, class, A
return class
}
ActiveWinClassNN() {
MouseGetPos, , , id, class, 2
return class
}
Ver 1.0
SetTitleMatchMode, RegEx
#IfWinActive ahk_class (XLMAIN|OpusApp|PPTFrameClass)
WheelLeft::ComObjActive((ActiveWinClass()="XLMAIN"? "Excel":(ActiveWinClass()="OpusApp"? "Word":"PowerPoint")) ".Application").ActiveWindow.SmallScroll(0,0,0,1) ; Scroll left.
WheelRight::ComObjActive((ActiveWinClass()="XLMAIN"? "Excel":(ActiveWinClass()="OpusApp"? "Word":"PowerPoint")) ".Application").ActiveWindow.SmallScroll(0,0,1) ; Scroll right.
#IfWinActive
ActiveWinClass() {
WinGetClass, c, A
return c
}
The script is based on previous topics i.e.:
http://www.autohotke...th-open-office/
http://www.autohotke...-in-excel-2007/



Sign In
Create Account
Last active: Feb 23 2013 08:29 PM
Back to top