-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux console and gpm #125
Comments
vtm already supports mouse in Linux console. The following conditions must be met
GPM is not used, vtm works with mouse events directly through |
There are several limitations when working in the linux console:
If your mouse doesn't work, write me your mouse model and I will add support for the protocol it uses. |
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. |
Thanks for your excellent support. I got it working with disabling the GPM and adding my user to the
I didn't like making the mice world writeable so I chose the more conservative approach. |
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 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
I added an option to vtm so that it tries to open not only |
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. |
I don’t remember it exactly, and I didn’t document it, but offhand there were such problems:
I was also very confused by this issue, I thought that I should not rely on gpm at all. |
Thank you!
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.) |
I've noticed that running vtm on the linux console and with gpm doesn't quite work. Is it meant to? Would it be difficult to support? Or am I doing something wrong? It seems that GPM mouse events are simply ignored. I'm not sure if I can achieve anything without a mouse there.
The text was updated successfully, but these errors were encountered: