I prefer to use the Standalone Viewer over the Viewer Pane when I want to have a peek at a plain text, Markdown, PDF, or an MS Office file, so I decided to try and create a hotkey for that.
After consulting the manual, I created a Shift+Space Lister hotkey with the following code:
Show LISTERLINK=toggle USEEXISTING=yes,avoid
When I click the Run button at the bottom of the hotkey window to test this, it opens and closes the standalone viewer window as expected. However, when I try to use the Shift+Space hotkey back in the Lister itself, it opens the standalone viewer window but doesn't close it.
Further investigation revealed the closing function of the hotkey works only if the Lister, and not the Standalone Viewer window, is in focus. Is it possible to make the hotkey close the Standalone Viewer on a second hotkey press while it is the window in focus (so the workflow would be: select a file > press the hotkey once to display its content > press the hotkey again to close the viewer and return to the Lister)?
I tried to create a Show VIEWERCMD=selectfile Viewer hotkey for testing purposes, but that didn't open the viewer window at all for some reason.
My initial understanding was that the Viewer hotkeys work only when the viewer is already open, which is why I thought a Lister hotkey is more suitable here. I'll go to read up on that again.
Thanks for that, @lxp.
I've created this hotkey for closing the viewer window, but ran into another problem.
When I look at plain text, Mardown, and similar files (.AHK for example), this is working perfectly. However, when I look at PDF or MS Office files (I mostly use .DOCX files so this is what I've tested with), the Viewer Window doesn't close.
Do you have any idea why this might be happening?
By the way, how did you get Enter to work as a hotkey? When I tried, it closed the hotkey settings window (pressed OK)
This seems to be the case. If I click back on the Lister and use the hotkey, the Viewer window is closed.
Bummer. This is somewhat defeating the purpose of the entire exercise.
Oh, I never noticed that little down-arrow that allows you to select Enter, Esc, or TAB as hotkeys. Thanks for the tip!
I tried switching from Acrobat Reader to SumatraPDF as the preview handler in the Meta plugin, but it doesn't seem to have changed anything. I still cannot close the Viewer window by pressing the Shift+Space hotkey while previewing a PDF or a Word document.
Two observations to note:
If I manually switch the focus back to the Lister, by clicking on its window, the Viewer window does close.
If deliberately click on the Viewer window after it opens to ensure it has the focus, the hotkey doesn't work.
If anyone has an idea how to solve or workaround this, I'd appreciate any advice.
I also use SumatraPDF for viewing .pdf files. Pressing Esc or using the hotkey will close the viewer window. However, I haven’t had the same luck with Microsoft’s viewer for .doc files - only the mouse seems to close the viewer.
The Viewer window doesn't close for me (by pressing either the hotkey or Esc) even after I switched to Sumatra, but I'll investigate further. Perhaps something is not configured correctly somewhere.