Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Detecting when a USB Foot pedal is pressed


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Oct 23, 2017 6:16 AM Last Post By: Robert Triest
Peter Gannon

Posts: 23
Registered: 6/16/06
Detecting when a USB Foot pedal is pressed  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 20, 2017 9:24 AM
I have a Delphi Windows app (32 bit). I'd like to be able to detect when a USB Foot Pedal is pressed. These would be a standard USB foot pedal used in games, or other apps. Here's an example of one (though I'm not targeting this specific model - just a generic USB Foot pedal).
https://www.amazon.com/Pedal-Video-Control-Hands-Camera-Footswitch/dp/B0098PLPOI/ref=sr_1_5?ie=UTF8&qid=1508516582&sr=8-5&keywords=usb+foot+pedal
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Detecting when a USB Foot pedal is pressed  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2017 5:26 AM   in response to: Peter Gannon in response to: Peter Gannon
Peter Gannon wrote:

I have a Delphi Windows app (32 bit). I'd like to be able to detect
when a USB Foot Pedal is pressed. These would be a standard USB foot
pedal used in games, or other apps. Here's an example of one (though
I'm not targeting this specific model - just a generic USB Foot
pedal).
https://www.amazon.com/Pedal-Video-Control-Hands-Camera-Footswitch/dp/B0098PLPOI/ref=sr_1_5?ie=UTF8&qid=1508516582&sr=8-5&keywords=usb+foot+pedal

If you are lucky, there is an API for it.

--
Rudy Velthuis http://www.rvelthuis.de

"Everyone's values are defined by what they will tolerate when
it is done to others."
-- William Greider
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Detecting when a USB Foot pedal is pressed  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2017 6:05 AM   in response to: Peter Gannon in response to: Peter Gannon
Unlike serial ports USB ports are controlled by device drivers. There is no simple solution and there are only a few
libraries that will allow "general" use of the USB port. You can take a look to the WinUSB project on sourceforge.

https://sourceforge.net/projects/winusb-delphi/

or

http://www.torry.net/vcl/system/otherhardware/dlpiusb.zip

"USB is a serial master-slave bus not a serial line. Addressing the "USB port" is like trying to address your ethernet cable.
The bus itself is invisible on software level. You access devices. How the device is accessed is up to the device.
Usually the device falls into a device class and a Windows class driver is handling it.
Those class drivers have no API of their own.
They add the device to other non-USB-specific APIs.
USB sticks aka mass storage devices for example are almost completely handled by normal file system access."

Edited by: Robert Triest on Oct 23, 2017 3:16 PM

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02