Page 1 of 1

Quickly move left to right in details view

Posted: 04 Oct 2017 19:57
by CutterKin
Scenario: Viewing folders with files that have very long file names, in "Details" view, with only "Name" & "Modified" columns selected. When filenames are too long to fit on the screen, a scroll bar is presented at the bottom so you can quickly pan the list left or right with a mouse to see the dates in the "Modified" column, then pan back to see the beginning of the filenames again.

My problem: I control XYplorer with a 5 button remote control from across the room that simulates keyboard presses. No mouse control. Currently to see the off-screen part of the filenames/dates I use left & right keyboard arrow presses to scroll left or right as needed. This works, but often requires many, many button presses to scroll all the way left or right if I have an exceptionally long filename in the list.

My question: Is there any keypress/script/macro/trick I can use to have a single keypress scroll all the way to the right, and then return all the way to the left via another keypress? I don't need to see what is in the middle along the way. I just want to rapidly jump back and forth from whatever beginning part of the filename fits on the screen, all the way right to the end so I can see the date column, then jump all the way back left to the beginning again.

I hope I explained clearly, and thanks for any help with this!

Re: Quickly move left to right in details view

Posted: 04 Oct 2017 20:13
by highend
Use an autohotkey script...

Modify the used keys to what your controller emulates
and lower / higher the value if you need to scroll more or less...

Code: Select all

#NoEnv
#SingleInstance Force

#IfWinActive ahk_class ThunderRT6FormDC
F11::Sendinput {Right 40}
F10::Sendinput {Left 40}
#IfWinActive

Re: Quickly move left to right in details view

Posted: 04 Oct 2017 20:39
by CutterKin
@highend That is more or less what I am doing now. The remote software has a feature to repeat a keypress when the button is held down, and it seems to work as fast as actually holding down the right/left arrow on my keyboard. Trouble is that even with the keyboard repeat rate set to maximum, it literally takes hundreds of keypresses to get all the way left or right. This takes 5-10 seconds of "hold down the button" time in each direction. I'm looking for something faster, preferably an instant jump all the way left or right.

I appreciate the help, but still would like a better way...

Re: Quickly move left to right in details view

Posted: 04 Oct 2017 21:00
by highend
You didn't actually try this, correct?

If I set the value to 200 I can scroll from left to right with a single keystroke
with a filename 240 chars long and only the first 12 chars visible
full.png
I'm just pressing F11 once and then F10 once:
scroll.gif

Re: Quickly move left to right in details view

Posted: 04 Oct 2017 21:25
by CutterKin
highend wrote:You didn't actually try this, correct?

If I set the value to 200 I can scroll from left to right with a single keystroke
with a filename 240 chars long and only the first 12 chars visible

full.png

I'm just pressing F11 once and then F10 once:
scroll.gif
Correct. I am at work and won't be able to try it until I get home. But I have tried a couple other things to "rapid fire" keypresses to get the job done, and all seem to be limited by how fast the machine can accept and process those keypresses. I'm using very large fonts and very long filenames so that may be slowing down the response time... Anyway, I will try your suggestion tonight or tomorrow, and I hope to report back that it works...

Re: Quickly move left to right in details view

Posted: 04 Oct 2017 22:37
by highend
The larger the font, the more steps it requires to scroll -> The slower it gets to process the send input

In theory this would be solvable by using GetScrollInfo / SetScrollInfo (Win32 API Calls)
where the position of the scrollbar can be controlled (min, max)

The problems (so far)
- XY control class names are not fixed (solvable)
- GetScrollInfo on a list pane with belonging scrollbars always fails...

Re: Quickly move left to right in details view

Posted: 05 Oct 2017 07:34
by highend
One other (working) way:

You need to adapt the variables in the created .ini file after running it for the first time!

So run it once, quit it, edit the .ini file, run it again

The variables to adapt:
ScrollBarControlName = The control name of the scrollbar to click, use e.g. Au3_Spy from the AutoHotkey package to find the name
ScrollBarArrowMargin = The width of the left / right arrow for the scrollbar + a few pixels (e.g. 5)
ClickCount = Check how many times you need to click manually on the outer left / right beginning / end of the scrollbar to reach it's end. Use that value here

Do not forget to change the F10, F11 hotkey to match yours!

Notes:
The mouse isn't moved to click the scrollbar control
This method should be very fast because the scrollbar only needs a few jumps to reach the other end, even with
very large fonts on large screens
...

Code: Select all

#NoEnv
#SingleInstance Force
SetBatchLines, -1

; Get / Set ini values
iniFile := A_ScriptDir "\" RegExReplace(A_ScriptName, "\.(ahk|exe)", ".ini")
if !(FileExist(iniFile))
    IniFile_Create(iniFile)
else
    IniFile_Read(iniFile)
return

; Rightmost click
F11::
    ControlGetPos, , , scrollbarWidth, , %ini_ScrollBarControlName%, ahk_class ThunderRT6FormDC

    xPosRel := scrollbarWidth - ini_ScrollBarArrowMargin
    SetControlDelay -1
    ControlClick, %ini_ScrollBarControlName%, ahk_class ThunderRT6FormDC, , , %ini_ClickCount%, NA x%xPosRel%
return

; Leftmost click
F10::
    SetControlDelay -1
    ControlClick, %ini_ScrollBarControlName%, ahk_class ThunderRT6FormDC, , , %ini_ClickCount%, NA x%ini_ScrollBarArrowMargin%
return



; ==================================
; = GOTO: FUNCTIONS - IniFile_Create
; ==================================
IniFile_Create(iniFile) {

    ; A "%" character in a continuation section must be escaped via "`"!
    iniContent =
    ( LTrim
        [Settings]
        ScrollBarControlName=ThunderRT6HScrollBar6
        ScrollBarArrowMargin=20
        ClickCount=5

    )

    ; Write default .ini file and read it
    FileAppend, % iniContent, % iniFile, UTF-16
    IniFile_Read(iniFile)

    return
}


; ================================
; = GOTO: FUNCTIONS - IniFile_Read
; ================================
IniFile_Read(iniFile) {
    global ini_ScrollBarControlName, ini_ScrollBarArrowMargin, ini_ClickCount

    IniRead, ini_ScrollBarControlName, % iniFile, Settings, ScrollBarControlName
    IniRead, ini_ScrollBarArrowMargin, % iniFile, Settings, ScrollBarArrowMargin
    IniRead, ini_ClickCount, % iniFile, Settings, ClickCount

    return
}

Re: Quickly move left to right in details view

Posted: 06 Oct 2017 18:53
by CutterKin
Although I did not use your method exactly, it inspired me to a very similar solution...

I am not very familiar with AutoHotkey, but looking at your post reminded me that another utility I *am* very familiar with, NirCmd from NirSoft, also has the same ability to move the mouse around via the command line. So I whipped together a batch file that basically clicks on the scroll bar and drags it all the way to the right, and another to the left. I programmed the remote software to execute the appropriate batch file when the left right remote keys are press, and voila, it worked. Sounds very clumsy but seems to work very well.

I sincerely appreciate the help finding a solution!