Back Forward buttons on mouse; More features

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, xnview

Post Reply
ShrapNull
Posts: 6
Joined: Sat Jan 28, 2012 4:31 pm

Back Forward buttons on mouse; More features

Post by ShrapNull » Sun Jan 29, 2012 10:14 am

Since the last post on this topic is years old, I thought I would start a new one. I have written a script which makes the back & forward buttons work properly in Xnview without breaking any other functionality.

Create a new autohotkey script, then right click it & edit the script. Paste the following 3 lines at the bottom and save. Then double click on the file.

Code: Select all

#IfWinActive ahk_class XmainClass
XButton1::PostMessage, 0x111, 335, 0, , XnView
XButton2::PostMessage, 0x111, 336, 0, , XnView
That should have the buttons working as expected.

-----------------------------------------------------
Not stopping there, I have extended the script. I have added the following:
Holding [ctrl] + pressing the mouse back button OR holding down right mouse button while pressing the mouse back button will bring xnView up a level to the parent directory.

Holding [ctrl] + scrolling mousewheel up (OR holding right mouse button + scrolling mouse wheel up) will move into the previous folder in the directory.
Similarly holding [ctrl] + scrolling mousewheel down (OR holding right mouse button + scrolling mouse wheel down) will move to the next folder in the directory.

Hopefully these new addons will make Xnview much easier to navigate using the mouse.

The full script now is:

Code: Select all

#IfWinActive ahk_class XmainClass 

XButton1::PostMessage, 0x111, 335, 0, , XnView
XButton2::PostMessage, 0x111, 336, 0, , XnView

;go up a level
RButton & XButton1::
	PostMessage, 0x111, 322, 0, , XnView
return
^XButton1::PostMessage, 0x111, 322, 0, , XnView


;previous folder
RButton & WheelUp::
	PostMessage, 0x111, 337, 0, , XnView
return
^WheelUp::PostMessage, 0x111, 337, 0, , XnView


;next folder
RButton & WheelDown::
	PostMessage, 0x111, 338, 0, , XnView
return
;next folder
^WheelDown::PostMessage, 0x111, 338, 0, , XnView

RButton::
	Send {RButton down}
	Send {RButton Up}
return

#IfWinActive
**EDIT: The full script broke the right-click context menu. It is now fixed

Let me know how you get on.
Thanks :)

Post Reply