USB foot pedal

wblock@

Developer
I've thought for quite a while that a foot pedal could be useful to trigger macros or as a keyboard shortcut. This morning at a yard sale, there was a transcription pedal. It looked old, but I checked the cable connector--it was USB! For the price of $1.50... why not? It is the one shown here: http://code.google.com/p/footpedal/.

To get it working, I used Thread 24069 as a guide.

The first step was to have devd(8) change permissions on the /dev/uhid0 device when it was attached. This was added to my devd(8) customizations file:
/etc/devd/wb.conf
Code:
# WB
# change permissions on foot pedal uhid device
attach 20 {
        device-name "uhid[0-9]";
        match "vendor" "0x05f3";
        match "product" "0x00ff";
        action "chmod g+w /dev/$device-name";
};
usbconfig -d 0.5 dump_device_desc was used to see the vendor and product IDs.

devd(8) must be restarted after changes:
# service devd restart

Next was to set up usbhidaction(1) to do what I wanted, which for a test was to type <acronym> when the left button is pressed, and </acronym> when the right button is pressed. (There is a lot of FreeBSD documentation with acronyms that still need these markup tags.)

~/usbhidaction.conf
Code:
# item (event)          value   debounce        action
Button:Button_1         1       0               xdotool type "<acronym>"
Button:Button_2         1       0               xdotool type "b"
Button:Button_3         1       0               xdotool type "</acronym>"

x11/xdotool is used to type these strings. "b" is just a placeholder for the large middle button.

To start usbhidaction(1):
usbhidaction -f /dev/uhid0 -c ~/usbhidaction.conf
 
I'm well aware that this thread is going on 12 years old, however I'm trying to distinguish the device name for this pedal on 14.2-RELEASE. ie. what parameter to use in the wb.conf

user@t450s ~ [1]> cat vecpedal
Apr 13 13:53:50 t450s kernel: ugen0.4: <VEC VEC USB Footpedal> at usbus0
Apr 13 13:53:50 t450s kernel: usbhid0 on uhub0
Apr 13 13:53:50 t450s kernel: usbhid0: <VEC VEC USB Footpedal, class 0/0, rev 1.10/1.20, addr 3> on usbus0
Apr 13 13:53:50 t450s kernel: hidbus0: <HID bus> on usbhid0
 
I'm aware of the ids, they're the same as the OP's. I'm referring to this part: device-name "uhid[0-9]";, as there's no /dev/uhid* on my system
 
I'm aware of the ids, they're the same as the OP's. I'm referring to this part: device-name "uhid[0-9]";, as there's no /dev/uhid* on my system

If you have hw.usb.usbhid.enable="1" I'd try running this and connect the foot pedal in 3 seconds:

Code:
su - root -c "sysctl 'hw.usb.usbhid.enable=0' && sleep '3' && sysctl 'hw.usb.usbhid.enable=1' && chmod '060' '/dev/uhid0'"

That works to get a joystick working for FlightGear and a Solo U2F key for 2FA through Firefox on 14.2.

usbhid doesn't put devices on /dev/uhid# but I use it for multimedia keys on a USB keyboard. I'm not sure why some apps look at /dev/uhid#, but turning off usbhid temporarily lets the older USB driver catch the newly-plugged in device and put it on uhid while not affecting pre-connected devices (keyboard/mouse) already on newer usbhid. I don't think this is really a proper way to handle this, but it works :p
 
is there a /dev/usbhid0?
No.
I was curious what the name of this device was, as I have been interested in the idea of foot pedals for a while. The Google link in the first post has moved, and no longer points to the model. Based on the 0x00ff product code, it is the VEC Infinity IN-USB-3 pedal: https://martelelectronics.com/infinity-in-usb-3-universal-foot-pedal
My particular foot pedal is same as the OP's. It is a IN-USB-2, Ver 14. I bought two over a decade ago for transcription.
You have enabled usbhid(4) and uhid(4) is not available anymore. Try to kldload hidraw and set device-name to "hidraw[0-9]" after than.
No bueno.

I notice that the foot pedal is mapped (unsure of correct terminology?) to /dev/ugen0.2 which is a symlink to /dev/usb/0.2.0

If I manually chmod g+w that file and continue with the usbhidaction -f /dev/usb/0.2.0 -c ~/usbhidaction.conf I get served a usbhidaction: hid_get_report_desc() failed: Inappropriate ioctl for device

My ~/usbhidaction.conf file - wtype in place of xdotool as I'm on wayland:
Code:
# item (event)          value   debounce        action
Button:Button_1         1       0               wtype "<acronym>"
Button:Button_2         1       0               wtype "b"
Button:Button_3         1       0               wtype "</acronym>"
 
Back
Top