From e5e0998e2c37064c528f93610778cecb2b2ab97b Mon Sep 17 00:00:00 2001 From: mewrrythekibby Date: Tue, 10 Feb 2026 14:12:26 -0600 Subject: [PATCH] Add color keybind and fix backspace --- mewny.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mewny.rb b/mewny.rb index 4c385a4..109d026 100755 --- a/mewny.rb +++ b/mewny.rb @@ -287,7 +287,14 @@ def do_client socket.puts "#{VERSION[:CLN_CO8]}|#{rand(1..7)}" while (char = STDIN.noecho(&:getch)) exit if char == "\x04" # ^D - if char == "\x1b" # Detect arrows + if char == "\x0F" # (^O) Color change + if /[0-7]/.match? (char2 = STDIN.noecho(&:getch).upcase) + socket.puts "#{VERSION[:CLN_CO8]}|#{char2}" + next + else + char << char2 + end + elsif char == "\x1b" # Detect arrows char2 = STDIN.noecho(&:getch) if /[A-D]/.match? (char3 = STDIN.noecho(&:getch).upcase) socket.puts "#{VERSION[:CLN_ARO]}|#{char3}" @@ -298,6 +305,8 @@ def do_client elsif (char == "\x08" || # backspace char == "\x7F" ) # delete socket.puts "#{VERSION[:CLN_ARO]}|D" + socket.puts "#{VERSION[:CLN_TXT]}| " + socket.puts "#{VERSION[:CLN_ARO]}|D" next end socket.puts "#{VERSION[:CLN_TXT]}|#{clean_chars(char)}"