0.0
No release in over 3 years
Mouse click input listener , requirement: any modern terminal.(supported in most - Xfce Terminal, GNOME Terminal, Konsole, Alacritty, Kitty, ITerm2, etc)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 0.3.2
 Project Readme

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.