Skip to content

XAJX179/mouse_input

Repository files navigation

MouseInput

Documentation Rubocop Ruby Test

get mouse click input inside terminal.

mouse_input_gem.mp4

Note

supported in most - Xfce Terminal, GNOME Terminal, Konsole, Alacritty, Kitty, ITerm2, etc

requirement is support for SGR mode(CSI?1006h)

Important

tmux users must :set mouse on to enable mouse mode

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add mouse_input

If bundler is not being used to manage dependencies, install the gem by executing:

gem install mouse_input

Test it

after installing the gem - run mouse_input in your terminal and click anywhere in terminal

mouse_input

if you see X and Y coordinates printed correctly it works

Usage

require 'mouse_input'
coords = MouseInput.Read # listens for mouse click and returns X and Y coords.
pp coords # will print X and Y coords

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/XAJX179/mouse_input. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the MouseInput project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

read mouse input in terminal.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages