Anon Gordon
Anon Gordon

Reputation: 2539

How can I send arrow key presses to a process using Expect.pm

Seems like this should be obvious, but how do I send arrow key presses to a process using Expect.pm? Does it depend on the terminal type I am using (vt100) or do I send keyboard scancodes?

TIA.

Upvotes: 5

Views: 4154

Answers (1)

Jonathan Feinberg
Jonathan Feinberg

Reputation: 45324

It does indeed depend on your current TERM environment variable. Once that's set correctly (say VT220 or linux), then arrow keys are

up:    "\c[[A"
down:  "\c[[B"
left:  "\c[[D"
right: "\c[[C"

Upvotes: 5

Related Questions