Hello all,
I recently purchased 2 net4801 that now run OpenBSD 4.4 Release.
I attached a USB Keyboard to the USB Port.
In my dmesg, the USB Keyboard gets attached to /dev/wskbd1
I want to automatically run a Program at boot that logs and processes Keyboard
Input. How can i get to the Keyboard Input made on a USB Keyboard that i
attached to my Soekris USB Port? Means: How can i capture whatever is entered
on the USB Keyboard, so i can use it in my program?
Here is a hypothetical Perl Program that takes Input and writes it to a file.
I am aware that noone will see the print Statements when there is no screen,
they are just for examples sake when i run this from a ssh session:
<code>
#!/usr/bin/perl
use strict;
use warnings;
open(my $fh, '>', '/var/log/reader.log') or die $!;
while ('TRUE') {
print "Enter ID :";
chomp(my $id = <STDIN>);
print $fh " You entered $id\n";
if ($id eq 'exit') {
print "Exiting\n";
close($fh);
exit;
}
}
</code>
The above will not work for me, because when the Machine is running
unattended, there is noone who logged in, the Program wouldn't know where to
take the input from. I need to somehow make my Program read directly
from the Keyboard Device Entry, and take its Input from there. Can anyone
help me out, it would be great. I hope i have been concise but clear with my
Problem.
Thanks and best regards,
David
_______________________________________________
Soekris-tech mailing list
[email protected]
http://lists.soekris.com/mailman/listinfo/soekris-tech