Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Human Interface Devices Communicator For Delphi/C++ Builder On Windows

Communicating with Human Interface Devices such as Alphanumeric display, Bar Code Reader, Sensors, Volume control on Speakers/Headsets becomes a primary use case for real-world applications. Do you spend more time in building libraries to communicate with HID for your Delphi/C++ and Lazarus Applications? WINSOFT Provides a powerful library to get the job done. It uses the standard Windows HID API.

Features:

Versions Supported: Delphi/C++ Builder 5 – Delphi 10.4 and Lazarus 2.0.8.

Platforms: Windows;  

Steps to Download and use the Native HID Library:

  1. Download Native HID and Unzip the file.
  2. Navigate to the Library folder for different Versions. e.g) Delphi10.4.
  3. Read the Readme.txt file to know about features and copyright information.
  4. Create a Windows VCL Application and use Hid.pas in the uses section.
  5. Include the Library folder into Project->Options->Delphi Compiler->Search Path.
  6. Compile and check for using the library.

NativeHID Download and Use demo:

Key HID concepts:
Report -Reports are the actual data that is exchanged between a device and a software client.

Report Descriptor – The Report Descriptor describes the format and meaning of the data that the device supports.
UsageTables – Contain a list with descriptions of Usages, which describe the intended meaning and use of a particular item described in the Report Descriptor. For example, a Usage is defined for the left button of a mouse.  USB-IF WorkGroup Publishes the Usage Tables. See USB-IF HID Specifications.

How to build applications using Native HID library:

1. Open Rad Studio 10.4 and Create a Windows VCL Application, use Hid.pas in the uses section.
2. Include the Library folder into Project->Options->Delphi Compiler->Search Path.
3.[crayon-673f661b7ee05646968808-i/]

4. [crayon-673f661b7ee11216868680-i/]

5. ShowDeviceProperties.[crayon-673f661b7ee13302255746-i/]

6. Get Device Names, [crayon-673f661b7ee15557432970-i/]

7.For each DeviceNames GetFeatureReport [crayon-673f661b7ee17708060009-i/]

8. For each DeviceNames GetInputReport : [crayon-673f661b7ee18864597806-i/]

9. For each DeviceNames Read by reopening the Device in Read only:[crayon-673f661b7ee1a153452879-i/]

10.[crayon-673f661b7ee1b600850147-i/]

Native HID Library Code demo :

Conclusion:  It’s quite easy to interact with HID in your applications. WINSOFT saved our time in nailing the Windows HID API and helped us to build quickly using the NativeHID Library.  

Head over and check out the full WINSOFT Native HID Library for Access in Delphi and C++Builder.

Like what you see? You can get the Native HID Library and over 100 other fantastic WinSoft components with our Enterprise Component Pack. For a limited time, when you purchase RAD Studio Enterprise or Architect Edition at special Upgrade Pricing, you will also get this package of third-party software worth over $13,000, including the full WinSoft Component Library, at NO EXTRA COST! Step up to RAD Studio 10.4.1 today!

Exit mobile version