Code Monkey home page Code Monkey logo

Comments (8)

jocutajar avatar jocutajar commented on August 22, 2024 1

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.

o-sdn-o avatar o-sdn-o commented on August 22, 2024

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
  • 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.

o-sdn-o avatar o-sdn-o commented on August 22, 2024

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.

o-sdn-o avatar o-sdn-o commented on August 22, 2024

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.

o-sdn-o avatar o-sdn-o commented on August 22, 2024

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.

 avatar commented on August 22, 2024

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.

o-sdn-o avatar o-sdn-o commented on August 22, 2024

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.

from vtm.

 avatar commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.