vhidkb

virtual HID keyboard
git clone git://git.rr3.xyz/vhidkb
Log | Files | Refs | README | LICENSE

README (1954B)


      1 VHIDKB(1)                      User Commands                          VHIDKB(1)
      2 
      3 NAME
      4        vhidkb - virtual HID keyboard
      5 
      6 SYNOPSIS
      7        vhidkb [-h] [-d DEVICE] [-t DELAY]
      8 
      9 DESCRIPTION
     10        vhidkb creates a virtual 256-key HID keyboard with N-key rollover using
     11        the Linux /dev/uhid interface. Each key starts in the released state,
     12        and each byte received over stdin toggles the key of that number. Keys
     13        are numbered in accordance with the HID usage page 0x07. vhidkb
     14        destroys the virtual keyboard and exits after reaching EOF.
     15 
     16 OPTIONS
     17        -h     Display a help message.
     18 
     19        -d DEVICE
     20              Use DEVICE as the /dev/uhid interface instead of "/dev/uhid".
     21 
     22        -t DELAY
     23              Wait DELAY milliseconds after the first process opens the HID
     24              device before sending key events. If DELAY is negative, then key
     25              events are sent even if no process has the HID device open. By
     26              default, vhidkb acts as if "-t 100" is passed as an option.
     27 
     28 NOTES
     29        The -t option exists as a hack to solve timing issues where an X server
     30        opens the HID device, closes it, and then opens it again, all within a
     31        few tens of milliseconds. (Why does Xorg do this? I don't know.) With
     32        0ms DELAY, the first opening causes vhidkb to start sending key events
     33        (assuming some data is available on stdin), but these events will most
     34        likely end up being discarded.
     35 
     36        By default, accessing /dev/uhid requires root privilages. For easy and
     37        secure use, the author recommends creating a "uhid" group for the
     38        /dev/uhid device and the vhidkb executable, with the latter having its
     39        set-group-ID bit set. Changing the group of /dev/uhid can be automated
     40        in init scripts.
     41 
     42 SEE ALSO
     43        HID Usage Tables <https://usb.org/sites/default/files/hut1_3_0.pdf>
     44 
     45 vhidkb                              2022-08-29                          VHIDKB(1)