Plugin

NoMiddleClickPaste

Disable Linux middle-click paste - Linux only

index.ts
Download

Source

src/plugins/noMiddleClickPaste/index.ts
1import { Devs, IS_LINUX } from "@utils/constants";
2import definePlugin from "@utils/types";
3
4function preventMiddleClick(e: MouseEvent) {
5 if (e.button === 1) {
6 e.preventDefault();
7 }
8}
9
10export default definePlugin({
11 name: "NoMiddleClickPaste",
12 description: "Disable Linux middle-click paste - Linux only",
13 authors: [Devs.Darxoon],
14 hidden: !IS_LINUX,
15
16 start() {
17 window.addEventListener("mouseup", preventMiddleClick);
18 },
19
20 stop() {
21 window.removeEventListener("mouseup", preventMiddleClick);
22 },
23});
24