# from Eric Wilhelm
# on Thursday 21 June 2007 03:27 am:

>http://scratchcomputing.com/svn/Linux-USBKeyboard/trunk/examples/numpad.pl

That link now gives 404 because it got renamed to echo_chars.pl.  But 
there are more fun examples in that directory now:

  http://scratchcomputing.com/svn/Linux-USBKeyboard/trunk/examples/

>I thought about having _char() return undef, but I'm a bit rusty on
> how to do that and that just means having to always check defined()
> vs the maybe-more-convenient "zero length string" we get with this
> setup.

I realized that the "char" return type was causing it to return 1-byte 
length "\0" scalars (I guess that's the default typemap?)  Couldn't 
figure out how to build a char* out of a char (I can make one that 
plays nicely with printf, but not with Inline ... hmph) so I just did 
SV* directly.

>I'm thinking a filehandle-like usage would be really cool, but I'm
>having a hard time finding a reason to write any more C code (because
> I could just pipe-open a child for reading.)

That's done now by "my $fh = Linux::USBKeyboard->open(@devspec);", which 
plays nicely with IO::Select :-D

Automated testing in this realm is a bit difficult.  I think it requires 
a robot pushing buttons :-/

--Eric
-- 
But you can never get 3n from n, ever, and if you think you can, please
email me the stock ticker of your company so I can short it.
--Joel Spolsky
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to