Printing arrow keys through perl

  • Thread starter madhav_a_kelkar
  • Start date
M

madhav_a_kelkar

Hi all,

I am using Perl/Expect and I want to send arrow keys to a
process running in background. But I was unable to simulate the arrow
keys through perl by using their ascii code and the perl chr()
function. How I can do it through perl?
Any help would just be great.

Thanks in advance.
Regards,
Madhav.
 
J

Joe Smith

I am using Perl/Expect and I want to send arrow keys to a
process running in background. But I was unable to simulate the arrow
keys through perl by using their ascii code and the perl chr()

I don't know about your keyboard, but my keyboard sends four
8-bit (not necessarily ASCII) characters for each arrow key
and five for each function key.

perl -MTerm::ReadKey -e '$|=ReadMode('raw');while($_ ne"q"){printf"%02x
",ord($_=ReadKey 0)}'

-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top