# Disable middle click multi select file/folder

**URL:** https://resource.dopus.com/t/disable-middle-click-multi-select-file-folder/41501
**Category:** Help & Support
**Created:** [June 17, 2022, 8:02am UTC](https://resource.dopus.com/t/disable-middle-click-multi-select-file-folder/41501 "2022-06-17T08:02:24Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![efourc](https://resource.dopus.com/letter_avatar_proxy/v4/letter/e/53a042/32.png) [@efourc](https://resource.dopus.com/u/efourc)
#### Post date: [May 15, 2023, 9:53pm UTC](https://resource.dopus.com/t/disable-middle-click-multi-select-file-folder/41501/8 "2023-05-15T21:53:05Z")

</div>

Hmm I actually meant to post this in the context of the other thread (linked below), it probably makes more sense there (I had both open while researching the issue... that's what I get for posting while tired):

> [@How to disable middle click selection?](https://resource.dopus.com/t/how-to-disable-middle-click-selection/40145):
>
> So I followed this tutorial to enable middle click to open folders in new tabs ([Middle click folder to open in new folder tab](https://resource.dopus.com/t/middle-click-folder-to-open-in-new-folder-tab/3308)). Which works fine.. but folders are still being selected with middle click. Could anyone direct me on how to turn this of…

> [@How to disable middle click selection?](https://resource.dopus.com/t/how-to-disable-middle-click-selection/40145/4):
>
> I've made a note to see how easy it'd be to prevent selection in that situation, maybe as an additional option (since you might still want selection with some commands).

It might be a little out of place in this thread now, but I'll follow up since I started.

=========

In my case, I was trying to use middle-click events to execute a command/script (set up in File Type-\>Events), but the multi-select functionality was still in the way.

Or to generalize: The 'mandatory selection' behavior of any type of click can be in the way for some use-cases.

I did more research while writing this draft, and I just found a workaround to get mostly what I want. I ended up switching to using left-click instead of middle-click in this case, since it worked more smoothly with a selection caveat (mentioned below).

**Workaround:**

_Result behavior:_ Ctrl + double-click a file to set it as 'focused' **and**'deselected', then run a script against it. (Can also set up **middle click** for the same.)

I found this tip from an old post or yours, and was able to use the first part of the command to change the focused file while leaving the selections on other files.

> [@Middlebuttin double click - activate inline rename](https://resource.dopus.com/t/middlebuttin-double-click-activate-inline-rename/17756/4):
>
> Makes sense. It's a bit of a kludge but this seems to work: Select DESELECT MAKEVISIBLE EXACT {file|noterm} Rename INLINE

So first, under **File Type** -\> **Events** -\> **Left double-click + Ctrl** , I can specify the command: `Select DESELECT MAKEVISIBLE EXACT {file|noterm}`

Then I can add a custom script command as part of the click event on newly-focused file, or run a separate hotkey script.

_Example hotkey:_

```auto
function OnClick(clickData)
{
	DOpus.ClearOutput();
	var cmd = clickData.func.command;
	cmd.deselect = false; // Prevent automatic deselection
	focused_item = clickData.func.sourcetab.GetFocusItem()

	// <Perform commands with focused_item here>
}

```

The minor limitation is that if I'm targeting one of the files I had already selected, that file's selection will be cleared. However, since Ctrl + left single-click already toggles selection, it's not too flow-breaking to toggle back.

---

_[View the full topic](https://resource.dopus.com/t/disable-middle-click-multi-select-file-folder/41501)._
