[EMAIL PROTECTED] ha scritto: > Salve a tutti, > ho la necessità di scrivere un programmino C che sia ingrado di > leggere ciò che una tastiera USB invia. > Il dispositivo non è proprio una tastiera ma un lettore di tessere che > viene visto da Linux (e da Windows) come una testiera USB e quindi se > eseguo una lettura mentre è aperto un editor di testo, sullo schermo > mi compare la sequenza numerica letta e poi va a capo. > Purtroppo io deve intercettare questo evento in background ed eseguire > successivi processi. > Qualcuno può darmi qualche spunto? Ho iniziato a vedere il sorgente di > un keylogger ma è troppo maestoso rispetto a ciò che serve a me. > > Grazie a tutti, > Gianluca > > Ciao, in generale becchi l'output semplicemente con un cat sul device corretto in /dev/input/ (nel mio caso, per la tastiera ps2, /dev/input/event0) e puoi redirigerlo come ti pare (ad es. via pipe) (devi essere root o comunque avere i diritti in lettura). Per trovare a realtime il nome esatto del device usb puoi provare a fare un grep su
cat /proc/bus/input/devices Il problema è poi interpretare i raw data ottenuti come stringhe di caratteri. Prova a vedere qui, per farti un'idea: http://www.linuxquestions.org/questions/showthread.php?t=454869 http://www.redsend.org/?p=142 My two cents -- Giorgio Luciani http://www.lucius.it -- Per REVOCARE l'iscrizione alla lista, inviare un email a [EMAIL PROTECTED] con oggetto "unsubscribe". Per problemi inviare un email in INGLESE a [EMAIL PROTECTED] To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]