# frozen_string_literal: true module Cryptum # Cryptum::Event Namespace module Event # This Module is used to Detect when Keys are Pressed on the Keyboard module KeyPress # Supported Method Parameters:: # Cryptum::Event::KeyPress.detect( # ) public_class_method def self.detect(opts = {}) terminal_win = opts[:terminal_win] Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.ticker_section ) Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.portfolio_section ) Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.order_plan_section ) Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.order_timer_section ) Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.market_trend_section ) Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.signal_engine_section ) Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.order_execute_section ) Cryptum::UI.detect_key_press_in_ui( key_press_event: terminal_win.key_press_event, ui_win: terminal_win.command_section ) rescue Interrupt, StandardError => e Cryptum::Log.append(level: :error, msg: e, which_self: self) end # Display Usage for this Module public_class_method def self.help puts "USAGE: order_book = #{self}.crypto() " end end end end