Answer the question
In order to leave comments, you need to log in
I wanted to write a function for reading the keyboard in Ruby, but it doesn’t understand shift, what’s wrong?
Have a function
def read_char
STDIN.echo = false
STDIN.raw!
input = STDIN.getc.chr
return input
end
Answer the question
In order to leave comments, you need to log in
line = STDIN.readline # идёт набор символов до нажатия клавиши <Enter>
lines = STDIN.read # идёт набор символов до нажатия <Ctrl-D>
? Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question