Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

keylogger hook question

Status
Not open for further replies.

Tony1l

Programmer
Dec 21, 2002
30
0
0
US
We have a dilemma at my work trying to record UPC data from order pickers while simultaneously recording them from an above camera. Many items appear the same so we also have a screen capturing device on the monitor, only the data is too small to view clearly from the recordings and is useless to resolve disputes. The easiest answer was adding a keylogger to the system. I wrote a Delphi app that displays the upc in large photogenic text which works somewhat. The problem is that even though it picks up all keyboard and wireless hand scanner data it misses all upc's scanned through a table top scanner. The table top scanner uses a keyboard wedge cable (Y-cable) and plugs into the keyboard PS/2 port.

Procedures & Functions Used (Pertinent Portions)

var
form1:Tform1;
MainHook: HHOOK;
Wnd1,Wnd2 : array[0..255] of char;

implementation

{$R *.dfm}

function KeyboardHook(Code: Integer; wParam : WPARAM; lParam : LPARAM): longint: stdcall;
var
Buffer: TEventMsg;

procedure Tform1.FormCreate(Sender: TObject);
begin
MainHook:=SetWindowsHoodEx(WH_JOURNALRECORD, KeyboardHook, hInstance, 0);
end;

Procedure Updateme(s:string);
begin
form1.memo1.lines.add(s);
end;

Procedure TranslateKey(key:Byte);
Begin
with Form1 do
begin
case Key of
VK_RETURN : Updateme('Enter');
VK_Back : Updateme('backspace');
65 : Updateme('a');
66 : Updateme('b');
//Edit Point here... all alpha & ctrl keys are listed
// even VK_NumPad is used for good measure

begin
Result:=0;
Buffer:=PEventMsg(lParam)^;
if buffer.message = WM_KEYUP then
begin
Translatekey(Buffer.paramL);
end;
end;

Unless I typo'd the above code this is the skeletal system which works for 80% of the data. Any suggestions as to what I could improve upon to capture data from a table scanner?

Thanks so much
Tony





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top