How to shift focus between Two Listers

I would like a command to shift the focus between the left and right lister in a Commander like Style.

In other words, it's like a toggle.

I press the key once, it moves the focus to the right lister. Press it again, it moves the focus to the left.

Set FOCUS=Toggle

Thanks,

I could see the Focus changing to the other panel. But I could not get it to turn from Orange to Green, ie show that it's "Active" so I tried

Set FOCUS=Toggle
Select FIRST

But of course it brings the Focus up to the First file or directory.

Not quite ideal.

Preferably it should just return to its previous cursor position the last time it was in that panel and just select that particular previously selected file.

Any advise would be appreciated.

Try this:

Set STATE=Dest FOCUS=Toggle

It will set the Source side to be the Destination (which makes the Destination side the Source) before swapping the input focus.

Edit:

A more obvious command which has the same effect as the above:

Set Source=Toggle Focus=Toggle

Also, if you want a command which toggles the focus and always sets the Source to be whichever side now has the focus (even if the Destination previously had the focus), then you can use this two-line command:

Set Focus=Toggle
Set Source=Focus

Works like a dream.

Thanks

WOW! Your answer helped me tremendously as I have multiple buttons that used the following commands:
Go CURRENT path
Set SORTBY=ColumnName

Which would work fine, EXCEPT if I had Opus running in Dual Display [vertical] and the Focus was on the Right lister and then the Right Lister was closed. Since the remaining lister did NOT have the focus, the SORTBY command would have no effect in the lister!

Changing the commands to:

Go CURRENT path
Set Focus=Toggle
Set SOURCE=Focus
Set SORTBY=ColumnName

Now working as expected! I couldn't figure out how to set the focus to a single lister in a single command and no amount of searching in the HELP files could give me a hint!

Thanks so much!

You shouldn't need to. If there's only one file display, and the window itself has focus, then that file display will have focus already.

The command you started with seems to work fine for me, even if the right file display has just been closed:

Go CURRENT C:\
Set SORTBY=size

If you want, you can make it more explicit that the second line should run in the folder that the first one goes into (this is needed sometimes but not always, and doesn't seem to be needed here):

Go CURRENT C:\
[
Set SORTBY=size
]

Thank you, I'll try that! For me, in Opus 12, when I closed the lister in a dual display that was the source and then ran the commands, the SORTBY wouldn't appear. If I added the lines as described then the SORTBY seemed to work, but when running on a SINGLE lister it would fail.

I've seemed to get it to work by using the following:

Go CURRENT /mydocuments
@if:Set DUAL=Off
Set Focus=Toggle
Set SOURCE=Focus
@if:common
Set SORTBY=name

BUT, of course, if the explicit BRACKETS work it will be a much simpler and elegant solution.

Thanks again for your response and advice!

[EDIT]

OK, I tried the BRACKET notation and it didn't work for me.

Here's the steps I've used to test:

  1. Open DO as a single lister
  2. Set Sort Order in the lister to something like "type"
  3. Open Dual Display vertical
  4. Select the Right lister as source
  5. Change the Right lister to some other location
  6. Close the Right lister
  7. Run the Commands from a button

In my case the SORTBY stays as "type" in the single lister and the Set SORTBY=name is ignored.

BRACKETING the Set SORTBY command as you illustrated did not work.

Maybe it's just me or my setup?

How are you running the command? Toolbar button (in the lister, or a floating toolvar?), Hotkey (lister or system-wide?), etc.

Thanks for you reply, Leo!

I am using a Toolbar Button (multi)... For example, here are my settings for MD Current, Open \mycdocuments in current lister and SORTBY=name:

Randall

I hadn't noticed this before, but you should remove the word "CURRENT" from your command.

Use Go CURRENT ... if you want to go to the current folder path. It doesn't make sense by itself, but it's usually combined with NEWTAB or something else, where you want to duplicate the current in a new tab or window.

If you want to go to a specific path such as the /mydocuments alias, then you don't want "CURRENT" in the command at all, just:

Go /mydocuments

That might explain why it wasn't working reliably before.

Aha, OK.

I think my case involved TWO different interactions.

The intent was that the button would work in both single and dual lister mode, affecting the source lister in dual mode.

So, if I open the lister in dual mode, have the right lister be SOURCE, CLOSE the right lister and THEN push the button while the remaining open lister is DEST with the commands:

GO /mydocuments
Set SORTBY=name

The lister changes to /mydocuments and the SORTBY=name takes effect BUT the lister remains as the DESTination lister.

In order for me to have the lister change to the SOURCE lister, I have to add:

Go /mydocuments
@if:Set DUAL=Off
Set Focus=Toggle
Set SOURCE=Focus
@if:common
Set SORTBY=name

Customized Command Button

This seems to work in both SINGLE and DUAL mode, always resulting in the selected (or remaining) lister set to SOURCE.

Thanks for all of your help!!!

Randall

1 Like

Unless you're using the Copy Files or Move buttons to copy things between separate, single-display, top-level windows, you don't usually need to worry about source/destination in a single-display window.

Understood, thanks.

Assistance much appreciated.

1 Like