• Stars
    star
    392
  • Rank 109,735 (Top 3 %)
  • Language
    C
  • Created almost 7 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Userspace tool to disable middle mouse button paste in Xorg

XMousePasteBlock

Listens for middle mouse click events and clears the primary X selection (and cut buffers) on detection to avoid accidentially pasting stuff all over the place.

About

No need to disable your precious middle mouse button bindings, no clearing of visual selections nor performance losses because of emptying the primary X clipboard periodically. With the utilization of XInput and Xlibs this has no measurable impact on performance whatsoever. No elevated privileges required. Just run within your regular users' X session.

Installation

On Arch Linux you may simply use the AUR package.

For all other distros, please follow the instructions below.

Dependencies

You might need to install the libev, Xlib and X11 Input extension headers.

Debian and derivatives (e.g. Ubuntu):

sudo apt-get install libev-dev libx11-dev libxi-dev

Fedora:

sudo dnf install libev-devel libX11-devel libXi-devel

Building

Compile and install:

make
sudo make install
Note for OpenBSD users (click to expand) Before running make, please uncomment the respective comments inside the Makefile

Running

Just add xmousepasteblock to your startup script/config.

Note: If you're using any kind of clipboard manager, make sure your it does not prevent clearing the PRIMARY selection. E.g. "Klipper" does that by default with the option "Prevent empty clipboard".

Known issues

In case of devices which are configured with middle mouse button hold-to-scroll (e.g. Trackpoints), it may happen that the primary selection clear action gets fired too late on older and slower machines. You can observe the behavior by building with the DEBUG flag set (make debug), running xmousepasteblock in a shell and watching the debug output as you long press and hold the mouse buttons.

This is due to the fact that the XI_RawButtonPress event only gets fired after releasing the middle mouse button (in case the user wanted to execute a scroll action). The only option to work around this is to disable the middle mouse button hold-to-scroll functionality on Trackpoint devices (which is often not desirable). To do so (using libinput):

xinput set-prop <device id> 'libinput Button Scrolling Button' 0

More Repositories

1

rpi-rf

Sending and receiving 433MHz signals with cheap GPIO RF modules on a Raspberry Pi
Python
502
star
2

YCast

Self hosted vTuner internet radio service emulation
Python
245
star
3

libstrangle

Frame rate limiter for Linux/OpenGL
C
92
star
4

steamlink_VirtualHereFreeInstaller

Custom native Steam Link application to install the free edition of VirtualHere
C
53
star
5

kodi-headless

A headless, dockerized Kodi instance for a shared MySQL database
Shell
48
star
6

graph89

A fork of Graph89 with UI and UX tweaks and fixes for modern Android versions. Graph89 is an emulator targeting the Android platform for TI89, TI89T, TI92, TI92+, V200, TI84+, TI84+SE, TI83, TI83+ and TI83+SE calculators.
C
37
star
7

kodi_addon_blackbarsremover

Kodi addon to automatically fit the video to screen, removing all black bars
Python
11
star
8

ouya_bootmenu

bootmenu for ouya. utilises kexec to boot images from system and datamedia.
C
10
star
9

android_device_lge_p940

LG P940/Prada 3.0 device tree
C
9
star
10

openwrt_knockd

up-to-date knockd for OpenWrt/LEDE
Makefile
8
star
11

android_kernel_lge_p940

LG P940/Prada 3.0 kernel repository
C
4
star
12

openwrt_wireguard-watchdog

Shell
4
star
13

openOBD

C++
3
star
14

scantool.net

C
2
star
15

android_packages_providers_ApplicationsProvider

Java
2
star
16

firefox_proton_inhibitor

Make Firefox usable again
JavaScript
2
star
17

arma3_timemarkers

Arma 3 mod/script for appending timstamps to user placed map markers
SQF
2
star
18

cm4mm-updater-manifest

CM4MM Updater update-site
1
star
19

android_vendor_lge_p940

LG P940/Prada 3.0 vendor blobs
Perl
1
star
20

compat-drivers-3.9-rc4-2

C
1
star
21

osmonitor-ng

A fork of the excellent OSMonitor by eolwral
Java
1
star
22

android_vendor_boxer8_ouya

Ouya vendor repo
Shell
1
star
23

oculus_nano_runtime

Oculus Runtime w/o bloat
NSIS
1
star
24

android_vendor_samsung_maguro

1
star
25

android_toolchains

external android toolchains
C
1
star
26

android_kernel_htc_kovsky

Sony Ericsson Xperia X1 kernel repository
C
1
star
27

kodi_repository_milaq

milaq's Kodi repository for addons
Shell
1
star
28

android_external_wpa_supplicant_6_compat

C
1
star
29

CSipSimple

CSipSimple is an open-source native SIP client for Android
Java
1
star
30

android_packages_providers_UserDictionaryProvider

Java
1
star
31

cm4mm-updater

CM4MM Updater core project
Java
1
star
32

mcabber_loudmouth

loudmouth for mcabber with support for building under cygwin
C
1
star
33

culfw

Firmware for the CUL family of devices
C
1
star
34

openwrt

custom openWrt builds
C
1
star
35

maverick_et-733_rf

Forked from https://www.grillsportverein.de/forum/threads/wlan-maverick-bbq-thermometer-raspberry-pi-edition.232283/
C
1
star