Comments (8)
Thanks for your excellent support. I got it working with disabling the GPM and adding my user to the input
group + login again.
$ ls -la /dev/input/mice
crw-rw---- 1 root input 13, 63 Nov 2 23:58 /dev/input/mice
I didn't like making the mice world writeable so I chose the more conservative approach.
from vtm.
vtm already supports mouse in Linux console.
The following conditions must be met
- RW access to the
/dev/input/mice
meta device- One time access (until reboot):
sudo chmod 666 /dev/input/mice
- Permanent access (set udev rules):
sudo echo 'SUBSYSTEM=="input", KERNEL=="mice", MODE="666"' > /etc/udev/rules.d/85-vtm-mouse-access.rules sudo udevadm control --reload-rules && udevadm trigger
- One time access (until reboot):
- and the presence of
TERM=linux
(by default for the linux console)
GPM is not used, vtm works with mouse events directly through /dev/input/mice
.
from vtm.
There are several limitations when working in the linux console:
- The mouse will not work when connecting to vtm remotely directly from the linux console prompt, the remote vtm does not have access to local
/dev/input/mice
and GPM doesn't support xterm-style mouse reporting. Run vtm locally in the linux console, and then connect remotely via the built-in vtm terminal. - Only a mouse that supports the
imps2 (ImPS/2 Generic Wheel Mouse)
protocol works in vtm, but it seems to me that now all mice support it.
If your mouse doesn't work, write me your mouse model and I will add support for the protocol it uses.
from vtm.
GPM interferes with vtm. To use the mouse in vtm in the Linux console, GPM must be disabled or uninstalled. Otherwise, GPM will highlight text in the console when dragging with the mouse for example.
from vtm.
adding my user to the input group
Adding a specific user to the input group opens read/write access to the keyboard device for all processes running on behalf of that user. File /dev/input/event*
logs keyboard events, for example.
Instead, you can restrict access only to the mouse device, but for this you need to create a separate device node:
#!/bin/bash
# Create a separate mice device node and allow users to access it.
# Group for allowed users.
sudo groupadd vtm
# Script for node init.
sudo bash -c 'cat <<EOF > /etc/udev/rules.d/mice.vtm.sh
#!/bin/bash
mice=/dev/input/mice.vtm
# See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/devices.txt
mknod --mode=660 \$mice c 13 63
chown root:vtm \$mice
EOF'
# Allow execution
sudo chmod +x /etc/udev/rules.d/mice.vtm.sh
# Script run rule.
sudo bash -c "echo 'SUBSYSTEM==\"input\", KERNEL==\"mice\", RUN+=\"/etc/udev/rules.d/mice.vtm.sh\"' > /etc/udev/rules.d/85-mice.vtm.rules"
# Trigger udev to reload rules
sudo udevadm control --reload-rules && sudo udevadm trigger
# Adding user to the vtm group
sudo usermod -a -G vtm user_name
user_name
- Your linux user name/login.
I added an option to vtm so that it tries to open not only /dev/input/mice
, but also /dev/input/mice.vtm
. I will make this option configurable in the future.
from vtm.
I see you mentioned GPM having unsolvable problems on Reddit. Can you mention what can't work? I'm just curious to try it out and see. :-) My GPM code is here, but a bit messy: I directly adapted it from ncurses mouse model (where I have to track all the buttons to know what to release later), and could probably simplify it a lot.
from vtm.
I don’t remember it exactly, and I didn’t document it, but offhand there were such problems:
- There seems to be incorrect processing of the ImPS/2 protocol when scrolling the wheel quickly,
|wheel delta| > 1
is interpreted as horizontal scrolling. No wheel reports if|wheel delta| > 2
.
See https://github.com/telmich/gpm/blob/e82d1a653ca94aa4ed12441424da6ce780b1e530/src/mice.c#L664-L681 - Sometimes mouse wheel events are not supported at all (apparently the wrong mouse port mode is being used for my mouse model that I tested on)
- And of course direct gpm dependency itself
I was also very confused by this issue, I thought that I should not rely on gpm at all.
from vtm.
Thank you!
And of course direct gpm dependency itself
That's a good point too. I couldn't build on Alpine Linux for a while because their gpm package didn't install correctly, and somehow no one noticed before me. (It's fixed now.)
from vtm.
Related Issues (20)
- Tiling window manager - select what to add HOT 5
- Project logo / icon HOT 10
- Per virtual terminal text search. HOT 5
- [feature request] launch application windows in vtm desktop through command line HOT 17
- Text wrap switch doesn't work
- Command arguments are not parsed correctly on POSIX systems
- Line splitting is broken and corrupts script expression
- Different exit code styles between UNIX and NT HOT 1
- Unnecessary translation layer if the applet type is not specified
- Dead modifier keys print incorrect characters in cmd.exe readline mode
- Graphical front-end (GUI-TUI Bridge) HOT 29
- Broken `vtm -?` output in non-UTF-8 code page
- Maintaining the "don't wrap configuration" HOT 4
- Standalone terminal focus is lost by left clicking on window menu
- PowerShell/PSReadLine don't use UTF-8 to echo input on Windows
- [Feature request] Always-on-top for app windows HOT 1
- [feature request] configurable window border HOT 8
- One-shot toggle to copy text while mouse tracking is active
- vtm does not work on ubuntu 20.04 since the version 9.84. HOT 1
- Incorrect order of text strings when right-click pasting in pwsh on Windows HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vtm.