DynamicCursesInput is a Ruby gem that simplifies the implementation of dynamic typing in terminal-based user interfaces (TUIs) built with the Curses library. It provides an intuitive way to handle user input, including special keys, without the need for extensive custom code.
To install the gem, add it to your Gemfile:
gem 'dynamic_curses_input'Then, run:
bundle installAlternatively, you can install it directly:
gem install dynamic_curses_inputHere's a simple example of how to use DynamicCursesInput in your Ruby application:
require 'curses'
require 'dynamic_curses_input'
Curses.init_screen
Curses.curs_set(1)
input = DCI.catch_input(true)
puts "You entered: #{input}"
Curses.close_screenIn this example, DCI.catch_input(true) captures user input, allowing for dynamic editing and special key handling.
DynamicCursesInput requires the following gems:
curses(~> 1.4)reline(~> 0.3.8)
It also has a development dependency on:
rubocop(~> 1.56)
This gem is licensed under the PixelRidge-BEGPULSE license.
For support or inquiries, please join our Discord community:
- X & Y Coordinates for Window Placement: There is a known bug where the X and Y coordinates for placing windows may not function correctly. This issue will be addressed in the next update. In the meantime, it's recommended to use the preset window locations.
To contribute or run tests locally, clone the repository and install the necessary dependencies:
git clone https://github.com/PixelRidgeSoftworks/DCI.git
cd DCI
bundle installRun tests using:
bundle exec rspecRun RuboCop for linting:
bundle exec rubocop