Change:
VSCode Version: Version: 1.27.1 (user setup) Commit: Date: 2018-09-06T09:21:18.328Z Electron: 2.0.7 Chrome: 61.0.3163.100 8.9.3 V8: 6.1.534.41 Architecture: x64 OS Version: Windows 10 Pro 64-bit (10.0, Build ) Steps to Reproduce: click item in explorer icon appear ! If you open developers tools works as expected Does this issue occur when all extensions are disabled?: Yes/No Yes
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: <!-- score: 0.478 --- <!-- score: 0.463 --<!-- potentialduplicatescomment --
Hmm strangely I am no longer getting a event when I do a middle mouse click This nicely works in stable. I see we use a different electron 2.0.9 compared to 2.0.7 but not sure if that update includes something which would influence this. Also the middle click nicely works in the tabs title area - how are you handling it there? did we change something in the tree which might effect this?
yeah see I removed  to prepare for Electron 3.0.x. We should probably wire this into the tree so that people can react to it ("onMiddleClick"). Simply forwarding the was resulting in other issues.
ok so the tree should still listen on events but bobble them up in a different way ? I can create a PR for this and you review?
yeah, the thing is, middle-click should not trigger the click, otherwise we might get wrong behaviour where people do not expect middle-click to do anything. Instead we can check clients of the tree (and list?) that want to do something on middle click and update them accordingly. Otherwise every client has to do an extra check for which mouse button was used for click.
currently the only clients of the tree that check something on middle click are explorer and quick open . For the list they are open editors view and the breakpoints view, however this still works for the breakpoints view and does not work for the open editors due to

Discussion:
@memoize get onMouseClick(): Event<IListMouseEvent<T>> { return filterEvent(mapEvent(domEvent(this.domNode, 'click'), e => this.toMouseEvent(e)), e => e.index >= 0); } @memoize get onMouseDblClick(): Event<IListMouseEvent<T>> { return filterEvent(mapEvent(domEvent(this.domNode, 'dblclick'), e => this.toMouseEvent(e)), e => e.index >= 0); } <ins> @memoize get onMouseMiddleClick(): Event<IListMouseEvent<T>> { return filterEvent(mapEvent(domEvent(this.domNode, 'auxclick'), e => this.toMouseEvent(e)), e => e.index >= 0); } </ins> @memoize get onMouseUp(): Event<IListMouseEvent<T>> { return filterEvent(mapEvent(domEvent(this.domNode, 'mouseup'), e => this.toMouseEvent(e)), e => e.index >= 0); } @memoize get onMouseDown(): Event<IListMouseEvent<T>> { return filterEvent(mapEvent(domEvent(this.domNode, 'mousedown'), e => this.toMouseEvent(e)), e => e.index >= 0); } @memoize get onMouseOver(): Event<IListMouseEvent<T>> { return filterEvent(mapEvent(domEvent(this.domNode, 'mouseover'), e => this.toMouseEvent(e)), e => e.index >= 0); }

get onMouseClick(): Event<IListMouseEvent<T>> { return this.view.onMouseClick; } get onMouseDblClick(): Event<IListMouseEvent<T>> { return this.view.onMouseDblClick; } <ins> get onMouseMiddleClick(): Event<IListMouseEvent<T>> { return this.view.onMouseMiddleClick; } </ins> get onMouseUp(): Event<IListMouseEvent<T>> { return this.view.onMouseUp; } get onMouseDown(): Event<IListMouseEvent<T>> { return this.view.onMouseDown; } get onMouseOver(): Event<IListMouseEvent<T>> { return this.view.onMouseOver; }

onKeyUp(tree: ITree, event: Keyboard.IKeyboardEvent): boolean; /** <ins> * Called when a mouse middle button is pressed down on an element. */ onMouseMiddleClick?(tree: ITree, element: any, event: Mouse.IMouseEvent): boolean; /** </ins> * Called when a mouse button is pressed down on an element. */ onMouseDown?(tree: ITree, element: any, event: Mouse.IMouseEvent): boolean;

* Returns an action item to render an action. */ getActionItem(tree: ITree, element: any, action: IAction): IActionItem; <del> } </del>  No newline at end of file <ins> } </ins>

this.viewListeners.push(DOM.addDisposableListener(this.domNode, 'keyup', (e) => this.onKeyUp(e))); this.viewListeners.push(DOM.addDisposableListener(this.domNode, 'mousedown', (e) => this.onMouseDown(e))); this.viewListeners.push(DOM.addDisposableListener(this.domNode, 'mouseup', (e) => this.onMouseUp(e))); <ins> this.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'auxclick', (e) => this.onMouseMiddleClick(e))); </ins> this.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'click', (e) => this.onClick(e))); this.viewListeners.push(DOM.addDisposableListener(this.domNode, 'contextmenu', (e) => this.onContextMenu(e))); this.viewListeners.push(DOM.addDisposableListener(this.wrapper, Touch.EventType.Tap, (e) => this.onTap(e)));

this.context.controller.onClick(this.context.tree, item.model.getElement(), event); } <ins> private onMouseMiddleClick(e: MouseEvent): void { if (!this.context.controller.onMouseMiddleClick) { return; } var event = new Mouse.StandardMouseEvent(e); var item = this.getItemAround(event.target); if (!item) { return; } this.context.controller.onMouseMiddleClick(this.context.tree, item.model.getElement(), event); } </ins> private onMouseDown(e: MouseEvent): void { this.didJustPressContextMenuKey = false;

sideBySide = tree.useAltAsMultipleSelectionModifier ? (event.ctrlKey || event.metaKey) : event.altKey; } <del> this.openEditor(stat, { preserveFocus, sideBySide, pinned: isDoubleClick || (event && event.middleButton) }); </del> <ins> this.openEditor(stat, { preserveFocus, sideBySide, pinned: isDoubleClick }); </ins> } } return true; } <ins> public onMouseMiddleClick(tree: WorkbenchTree, element: ExplorerItem | Model, event: IMouseEvent): boolean { let sideBySide = false; if (event) { sideBySide = tree.useAltAsMultipleSelectionModifier ? (event.ctrlKey || event.metaKey) : event.altKey; } if (element instanceof ExplorerItem && !element.isDirectory) { this.openEditor(element, { preserveFocus: true, sideBySide, pinned: true }); } return true; } </ins> public onContextMenu(tree: WorkbenchTree, stat: ExplorerItem | Model, event: ContextMenuEvent): boolean { if (event.target && event.target.tagName && event.target.tagName.toLowerCase() === 'input') { return false;

}); // Open when selecting via keyboard <ins> this.disposables.push(this.list.onMouseMiddleClick(e => { if (e && e.element instanceof OpenEditor) { e.element.group.closeEditor(e.element.editor); } })); </ins> this.disposables.push(this.list.onOpen(e => { const browserEvent = e.browserEvent; let openToSide = false; let isSingleClick = false; let isDoubleClick = false; <del> let isMiddleClick = false; </del> if (browserEvent instanceof MouseEvent) { isSingleClick = browserEvent.detail === 1; isDoubleClick = browserEvent.detail === 2; <del> isMiddleClick = browserEvent.button === 1 /* middle button */; </del> openToSide = this.list.useAltAsMultipleSelectionModifier ? (browserEvent.ctrlKey || browserEvent.metaKey) : browserEvent.altKey; } const focused = this.list.getFocusedElements(); const element = focused.length ? focused[0] : undefined; if (element instanceof OpenEditor) { <del> if (isMiddleClick) { element.group.closeEditor(element.editor); } else { this.openEditor(element, { preserveFocus: isSingleClick, pinned: isDoubleClick, sideBySide: openToSide }); } </del> <ins> this.openEditor(element, { preserveFocus: isSingleClick, pinned: isDoubleClick, sideBySide: openToSide }); </ins> } else { this.editorGroupService.activateGroup(element); }