Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

MS Office horizontal scrolling Fix for Trackpad++ driver


  • Please log in to reply
4 replies to this topic
Marcelo NS
  • Members
  • 8 posts
  • Last active: Feb 23 2013 08:29 PM
  • Joined: 24 Jan 2013

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: happy.png

 

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/



keyzer
  • Members
  • 10 posts
  • Last active: Jan 24 2013 11:37 PM
  • Joined: 12 Jan 2011

Thanks this looks great - question though - I haven't installed trackpad++ just yet - I have a newly-bought rMBP with Win8 and Office 2013 on it - horizontal scrolling works just fine right now, so why is this fix needed? Does it stop working when you install trackpad++?

 

Or Maybe MS fixed the problem with 2013? Does this issue (and fix) only apply to 2010/07 etc?

 

Thanks for your info happy.png.



Marcelo NS
  • Members
  • 8 posts
  • Last active: Feb 23 2013 08:29 PM
  • Joined: 24 Jan 2013

Hi Keyzer,

 

The scrolling issue is due to the awkward method used by Microsoft in the past for horizontal scrolling. In Win 8 seems to be better, but older programs like Office 2007-2010 start showing problems under win 8, regardless of using native bootcamp drivers or trackpad++. As you pointed may be Microsoft fixed it in 2013 (i cant test it i dont have 2013).

In my system whatever was working with bootcamp dirvers worked with trackpad++ (but better wink.png ).

My system is a MBA mid2011 Win8 Pro.  I have the H-Scrolling issue only in MS Office 2010 and Adobe Reader so far.... In my other programs (more than 40) all gestures work just fine.



Marcelo NS
  • Members
  • 8 posts
  • Last active: Feb 23 2013 08:29 PM
  • Joined: 24 Jan 2013

@Keyzer: Do you have H.Scrolling problems with Adobe (Acrobat reader or other)?

 

I have updated the script. Adding the horizontal functionality for Adobe. 

 

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

#IfWinActive Adobe
WheelLeft:: ControlClick, ScrollBar1, Adobe,, LEFT, 1, X0
WheelRight:: 
    ControlGetPos, sx, sy, sw, sh, ScrollBar1, Adobe
    sw-=1 ;in order to be "inside"
    ControlClick, ScrollBar1, Adobe,, LEFT, 1, X%sw%
#IfWinActive

ActiveWinClass() {
	WinGetClass, class, A
	return class
}


contradel
  • Members
  • 1 posts
  • Last active: Sep 12 2013 08:26 PM
  • Joined: 12 Sep 2013

Hey thanks dude. Works like a charm in Excel and Word 2013. Could you make it work inside Onenote 2013 aswell?

2012 Air, W8 via Bootcamp. Latest Trackpad++