Board logo

Subject: unit CnRawInput x {$I CnPack.inc} [Print This Page]

Author: mapasoal    Time: 2010-8-3 00:00     Subject: unit CnRawInput x {$I CnPack.inc}

Dears,

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
http://www.codeproject.com/KB/system/rawinput.aspx

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);
begin
        if GetKeyBoardName(1) = 'KeyBoard1' then
           //let normal data flow
       else
            if GetKeyBoardName(2) = 'KeyBoard2' then
               panel.caption := //keboard data
           
end;


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 CnPack.inc}

Who can help me ?
Author: allensmith    Time: 2015-1-27 14:59     Subject: re:

I met the same problem.
Author: allensmith    Time: 2015-1-27 15:04     Subject: re:

I met the same problem. I can't understand the error {$I CnPack.inc},i search it in Google but still can't find the answer.Really disgusting!2 of 5 barcode2 of 5 barcode
Author: Passion    Time: 2015-1-27 16:34

Could you refer to the example in cnvcl/Examples/RawInput?




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0