src/vs/base/browser/ui/list/listWidget.ts/List/onContextMenu
class List:	@memoize get onContextMenu(): Event<IListContextMenuEvent<T>> {
		let didJustPressContextMenuKey = false;

		const fromKeyDown = Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, 'keydown')).event)
			.map(e => new StandardKeyboardEvent(e))
			.filter(e => didJustPressContextMenuKey = e.keyCode === KeyCode.ContextMenu || (e.shiftKey && e.keyCode === KeyCode.F10))
			.map(stopEvent)
			.filter(() => false)
			.event as Event<any>;

		const fromKeyUp = Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, 'keyup')).event)
			.forEach(() => didJustPressContextMenuKey = false)
			.map(e => new StandardKeyboardEvent(e))
			.filter(e => e.keyCode === KeyCode.ContextMenu || (e.shiftKey && e.keyCode === KeyCode.F10))
			.map(stopEvent)
			.map(({ browserEvent }) => {
				const focus = this.getFocus();
				const index = focus.length ? focus[0] : undefined;
				const element = typeof index !== 'undefined' ? this.view.element(index) : undefined;
				const anchor = typeof index !== 'undefined' ? this.view.domElement(index) as HTMLElement : this.view.domNode;
				return { index, element, anchor, browserEvent };
			})
			.event;

		const fromMouse = Event.chain(this.view.onContextMenu)
			.filter(_ => !didJustPressContextMenuKey)
			.map(({ element, index, browserEvent }) => ({ element, index, anchor: { x: browserEvent.pageX + 1, y: browserEvent.pageY }, browserEvent }))
			.event;

		return Event.any<IListContextMenuEvent<T>>(fromKeyDown, fromKeyUp, fromMouse);
	}