Reply To: Water Drain

Home Forums AR Sandbox Forum Water Drain Reply To: Water Drain

Oliver Kreylos

There are many brands/makes of USB buttons, but they vary widely in their capabilities, and it’s usually not specified what exactly they do. That’s dangerous.

In our AR Sandbox, we use a two-button switch, Delcom 706502-F, where the red button drains and the blue button deposits water.

Delcom also has one-button switches, such as this one, but they are rather pricey. On the upside, they are robust and known to work.

Delcom’s switches are programmable via a Windows-based utility available from their web site. They can be programmed as mouse buttons, keyboard keys, or joystick buttons. The ideal configuration for the AR Sandbox is one or two joystick buttons. Most cheap USB buttons only emulate keyboard keys, and usually in a dumb way that makes them unusable for the AR Sandbox.

To use a USB switch that’s configured as joystick button(s), one has to create a patch configuration file that makes it available as an additional input device, and then bind a water management tool to the new device’s button(s) using Vrui’s standard tool binding interface. Alternatively, one can bind a water management tool automatically via the same patch configuration file. Here’s the file I use to bind our two-button box to the add water / remove water functions:

section Vrui
  section Desktop
    inputDeviceAdapterNames (MouseAdapter, HIDAdapter)

    section HIDAdapter
      inputDeviceAdapterType HID
      inputDeviceNames (ButtonBox)
      section ButtonBox
        name ButtonBox
        deviceVendorProductId 0fc5:b080
    section Tools
      section DefaultTools
        section WaterTool
          toolClass GlobalWaterTool
          bindings ((ButtonBox, Button167, Button166))

The deviceVendorProductId setting would need to be adapted to the actual switch’s ID, and the actual button names (Button166 and Button167 in our case) might have to be changed.

The name of this patch configuration file, say SandboxButtons.cfg, is then added to SARndbox’s command line as such:

$ SARndbox [usual options] -mergeConfig SandboxButtons.cfg

Comments are closed.