Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Reading directly from a keyboard device, not simply <STDIN>

by f00li5h (Chaplain)
on Dec 16, 2008 at 05:11 UTC ( #730572=note: print w/ replies, xml ) Need Help??


in reply to Reading directly from a keyboard device, not simply <STDIN>

Term::ReadKey perhaps?

(I know it's not technically reading from the device, but it's close-ish)

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;


Comment on Re: Reading directly from a keyboard device, not simply <STDIN>
Download Code
Replies are listed 'Best First'.
Re^2: Reading directly from a keyboard device, not simply <STDIN>
by overrider (Acolyte) on Dec 16, 2008 at 05:30 UTC
    Yes, Term::ReadKey is what i am trying to use, see my example Code above. I seem to be doing it wrong though, as everytime i type something on my (attached to embedded box)keyboard , it just reads garbled characters instead of printing the string i actually typed.

    what i really want is to read (or sth close to read) from the keyboard device in the same way i would read from a device attached to a normal serial port.

      The link was supposed to be a nudge toword the docs...

      Term::ReadKey doesn't mention that it needs a file handle to do it's reading, have you tried without opening the $fh yourself, and just letting it default to using the current TTY?

      As for your nobody-logged-in issue, would it not be possible to spawn your perl scrpt from /etc/inittab? Then you will have everything you need set up (without having to log a user in via getty)

      Also, have you managed to get the module to behave the way you want on a box with a display? (it'll make debugging easier atleast)

      @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://730572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2015-07-08 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls