Always have one item selected

I searched everywhere, but did not find this simple functionality: always have at least one item selected in a lister. If I navigate to a folder, there is a focus on the first item, but it is not selected: I have to press the space bar to do it. However, if I press the down arrow, the second one is now selected, not just focused. If I press "up", the first item is now selected. So by using the keyboard, all items are always selected, except the first one when landing into the folder. Why is that? A form of racism against the first item in a folder? :slight_smile:

What is strange is that when you go up with backspace, the folder you are coming from is selected, not just focused (which is what I expect).

Preferences / File Displays / Options / Automatically select first file in folder

Aaaah... I had seen this option in Power Mode, but not there.
Thank you !

It almost works: in general, it works fine, but clicking on the background of the source deselects everything. Even in that case, I would like one item to remain selected.
I tried to circumvent that with a Script Addin, but:

  • there is no event for "selection changed" (unless I missed it), so it is not possible to capture the above event (the selection is cleared by clicking in the source background).
  • I used OnSourceDestChange to reselect at least when switching source/dest, but SourceDestData.tab.GetFocusItem() returns null (as documented) for some focused items, such as the parent directory ".." if you have activated its display, while it is selectable. If did not find something like "Select FOCUSED", which would have done what I want when there is nothing selected...

Any advice?

THIS
Selects the current focus entry. It is possible for the entry with input focus to not be selected (for example, if you move the focus highlight with Control + Cursor-Down) and this command will select whichever entry is currently focused.

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Select.htm

Select FIRST could be useful as well.

Thank you.
No way to solve the first point (selection changed without OnSourceDestChange event), I guess?

Power Mode may have a mouse button setup that doesn’t do that, but it won’t affect other modes like Thumbnails.

You’re really fighting Windows and 40 years of user interface conventions at this point if you don’t want to be able to deselect things.

You’ll also be making it harder to use commands which do different things when nothing is selected. For example, calculating folder sizes will do all folders if there’s no selection and just the selected folders if there is a selection.

Ok, thank you.
Any chance we get one day an event OnSelectionChanged?

Scripts can already monitor/react to selection changes via window events (with a hidden/dummy window, if no UI is needed). I wouldn't really recommend it for something like this, though, as it'd complicate and slow things down slightly for a benefit I can't really see...

Why are you're so against having zero items selected? What is the actual issue with that? Sometimes nothing is selected and that's fine, valid, and even necessary in some cases. Where does it ever cause a problem?

It's a matter of habit: I am used to other orthodox file managers that always have something selected (I started with Norton Commander...) Pressing enter always does something, and I'm used to it. But it's ok, I guess I have to get used to something else. Out of sheer curiosity, what are you referring to with "via window events"?
Thanks anyway!

See the WatchTab method here for details:

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Dialog.htm

Woaaah!
That's indeed powerful, but I understand it can slow things down.
Thank you!