From: tho_mica_l Date: 2007-12-31T17:34:57+09:00 Subject: Re: Detecting Arrow Keys > Hmm... Something's not right here... Why are they all the same? Cursor keys on the terminal are most often sent as a sequence of three characters: 27, '[', 'A' ... up 27, '[', 'B' ... down 27, '[', 'C' ... right 27, '[', 'D' ... left 27 is escape. I don't know why you'd want to check for cursor keys but if it's for line editing you're probably better of with using a library that already does this. I'm not 100% sure but Highline (http:// highline.rubyforge.org/) might be of help here. Isn't readline already distributed with ruby by default? Why write a ruby version of a standard ruby library?