CnPack Forum


 
Subject: unit CnRawInput x {$I CnPack.inc}
mapasoal
新警察
Rank: 1



UID 50200
Digest Posts 0
Credits 4
Posts 1
点点分 4
Reading Access 10
Registered 2010-8-2
Status Offline
Post at 2010-8-3 00:00  Profile | Blog | P.M. 
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 ?
Top
allensmith
新警察
Rank: 1



UID 191789
Digest Posts 0
Credits 4
Posts 2
点点分 4
Reading Access 10
Registered 2015-1-19
Status Offline
Post at 2015-1-27 14:59  Profile | Blog | P.M. 
re:

I met the same problem.
Top
allensmith
新警察
Rank: 1



UID 191789
Digest Posts 0
Credits 4
Posts 2
点点分 4
Reading Access 10
Registered 2015-1-19
Status Offline
Post at 2015-1-27 15:04  Profile | Blog | P.M. 
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
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2015-1-27 16:34  Profile | Blog | P.M. 
Could you refer to the example in cnvcl/Examples/RawInput?
Top
 




All times are GMT++8, the time now is 2024-11-24 10:22

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.008692 second(s), 9 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP