Hotkey to Focus Preview

Have a suggestion for "Everything"? Please post it here.
Post Reply
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Hotkey to Focus Preview

Post by mwsm »

Currently if the Preview panel has focus (eg when previewing a text file), the Tab key will move focus back to the Search field. However I have not found a keyboard shortcut to move focus into the Preview panel. Is there one already available? If not, could the Tab key cycle focus into the Preview panel (as in Windows Explorer)? Or a dedicated Hotkey in Options > Keyboard would also work well. This would be especially useful when previewing source code, etc.

Using Everything 1.4.0.713b in Windows 7 (x64).
therube
Posts: 4605
Joined: Thu Sep 03, 2009 6:48 pm

Re: Hotkey to Focus Preview

Post by therube »

You can assign a hotkey that acts as a toggle to turn Preview on/off (Alt+P or something like that).

And so you're actually "interacting" with the Preview pane?

In any case, it looks like a down|up-arrow will move focus to the next|previous item in the search list, regardless of (& I'm only looking a video at present) focus being in Preview or Search.
void
Developer
Posts: 15251
Joined: Fri Oct 16, 2009 11:31 pm

Re: Hotkey to Focus Preview

Post by void »

To make the preview pane a tab stop:
  • Completely exit Everything
  • Open your %APPDATA%\Everything\Everything.ini
  • Change the following line:
    preview_tab_stop=0
    to:
    preview_tab_stop=1
  • Save changes and restart Everything.
I've added: Add a keyboard shortcut to focus the preview pane to my TODO list.
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Re: Hotkey to Focus Preview

Post by mwsm »

@therube: Thanks for the suggestions, and agreed on all points. But what I'm specifically after is a keyboard shortcut to focus (i.e., move the cursor into) the Preview panel when previewing text files.

@void: Thanks for the quick response, that's exactly what I'm looking for. However, I'm seeing some unexpected behaviour when preview_tab_stop=1:

1) If the previewed file is an image, an empty text file, or a file type with no preview handler (e.g. an .exe), then the Tab key cycles in and out of the Preview panel as expected. In these cases there is no cursor in the Preview panel, but the focus is there per the context menu.

2) If the previewed file is using the native Windows text preview handler, then the Tab key no longer does anything at all (including not moving to the Search field). There does not appear to be any error, as nothing is written to the console (even if Everything is launched in --debug mode). EDIT: If the cursor is placed in the Preview panel manually then Tab will correctly cycle it to the Search field and then to the Results file, after which Tab has no apparent effect.

3) If the previewed file is using a third-party preview handler [1], then the Tab key cycles into the Preview panel, but not out of it. I realise that the behaviour of third-party handlers is not in your control, but it does behave as expected in Windows Explorer, so perhaps it's possible.

Using Everything 1.4.0.713b in Windows 7 (x64).

[1] For example: http://voidtools.com/forum/viewtopic.php?f=2&t=5541
void
Developer
Posts: 15251
Joined: Fri Oct 16, 2009 11:31 pm

Re: Hotkey to Focus Preview

Post by void »

Thanks for your reply.
1) If the previewed file is an image, an empty text file, or a file type with no preview handler (e.g. an .exe), then the Tab key cycles in and out of the Preview panel as expected. In these cases there is no cursor in the Preview panel, but the focus is there per the context menu.
The next release will not focus the preview if it is a image or executable (no preview handler). As for text, the focus is handled by the preview handler and out of my control.
2) If the previewed file is using the native Windows text preview handler, then the Tab key no longer does anything at all (including not moving to the Search field). There does not appear to be any error, as nothing is written to the console (even if Everything is launched in --debug mode). EDIT: If the cursor is placed in the Preview panel manually then Tab will correctly cycle it to the Search field and then to the Results file, after which Tab has no apparent effect.
It's a bug with the text preview handler.
IPreviewHandler::SetFocus succeeds, but the handler does not correctly set focus.
I've made the next release focus the first child of the preview container window (if the focus did not change) which appears to fix the issue.. Will need testing..
3) If the previewed file is using a third-party preview handler [1], then the Tab key cycles into the Preview panel, but not out of it. I realise that the behaviour of third-party handlers is not in your control, but it does behave as expected in Windows Explorer, so perhaps it's possible.
I'm probably not handling IPreviewHandler::TranslateAccelerator correctly, will look into a fix.

Other Notes:
F6 or Shift + F6 will tab-cycle major controls.
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Re: Hotkey to Focus Preview

Post by mwsm »

Thanks for looking into this! And thank you very much for developing this amazing program.
Post Reply