Although most of the Sort by modes can be set by clicking the Sort by Header, except for Sort by "Custom" order, to set it you either have to navigate the View menu or the Toolbar Sort by dropdown. This becomes cumbersome when you need to change Sort mode very often when viewer different folders especially that XnView treats Sort by modes as a global setting and not a per folder setting. This would be another feature request to have an option to save Sort by mode per folder would be very handy.
As a workaround, I use Autohotkey to send keystrokes to the View menu to set the few Sort by mode that I used most often, although it works, it is clumsy. A native keyboard shortcut implementation would be the most ideal, hence this feature request.
Code: Select all
;-------------- XnView MP key remap
#IfWinActive, ahk_exe xnviewmp.exe
!c::XnViewMP_sortMode("{Up 7}") ;sort by Custom Order
!m::XnViewMP_sortMode("{Down 2}") ;sort by Date Modified
!n::XnViewMP_sortMode("") ;sort by Name
return
XnViewMP_sortMode(sortKey)
{
LockMouse(True) ; Lock mouse cursor in place
; Check if the physical Alt key is currently pressed down
if GetKeyState("Alt", "P")
{
SendEvent, {Blind}v
}
else
{
SendEvent, !v
}
Sleep, 50 ; Allow menu to open
SendEvent, {Blind}{Down 2}{Right}%sortKey%{Enter} ; Select sort Mode item
LockMouse(False) ; Release mouse cursor
}
LockMouse(Lock := True) {
if (Lock) {
VarSetCapacity(rect, 16, 0)
DllCall("GetCursorPos", "Ptr", &rect)
; Set bottom-right bounding coordinates (X+1, Y+1)
NumPut(NumGet(rect, 0, "Int") + 1, rect, 8, "Int")
NumPut(NumGet(rect, 4, "Int") + 1, rect, 12, "Int")
DllCall("ClipCursor", "Ptr", &rect)
} else {
DllCall("ClipCursor", "Ptr", 0)
}
}