CnPack Forum » CnWizards IDE Wizards » unit CnRawInput x {$I}

2010-8-3 00:00 mapasoal
unit CnRawInput x {$I}


I'm new in the programing world but I always study to understand the Delphi 7, that I use at home.

I read this website link about, how to identify who keyboard sent data by USB conection:

Using Raw Input from C# to handle multiple keyboards

How this article is for C# and was using the google to find some thing for Delhpi 7 to help me.

I found the unit CnRawInput and in my project I have only 1 Form and the 2 Units: U_MainForm.pas and U_CnRawInput.pas.

after download the Rawinput.pas file I don't know how to use it ? I see there are functions:

    procedure RegisterRawInput;
    function GetKeyBoardCount: Integer;
    procedure SetEnabled(const Value: Boolean);
    procedure SetBackground(const Value: Boolean);
    function GetKeyBoardName(Index: Integer): string;

Is there a corect sequency to call them ?

I was reading that I need create a procedure in the MainForm as
procedure WMINput(var MSG :TMessage); message WM_INPUT;

and into it I have to write:
procedure TForm1.WMINput(var MSG: TMessage);
        if GetKeyBoardName(1) = 'KeyBoard1' then
           //let normal data flow
            if GetKeyBoardName(2) = 'KeyBoard2' then
               panel.caption := //keboard data

So I need a Data Flow Control to know if the data came form a keyboard let it normal flow if not get the data and keep it.

My keboard and BarCode Reader are in the USB pluged, and all BarCode Reader simulates a keboard; if my application can be hiden and only its icon is displayed in the TraySystem field of the screen there will be no problem if I use the notepad and a code was read from the Reader because the data will have other flow, so no conflicts.

When I try do use the unit as I wrote above occured an error {$I}

Who can help me ?

2015-1-27 14:59 allensmith

I met the same problem.

2015-1-27 15:04 allensmith

I met the same problem. I can't understand the error {$I},i search it in Google but still can't find the answer.Really disgusting![url=][color=#ffffff]2 of 5 barcode[/color][/url][url=][color=#ffffff]2 of 5 barcode[/color][/url]

2015-1-27 16:34 Passion
Could you refer to the example in cnvcl/Examples/RawInput?

页: [1]

Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.