External button for rain/drain

Home Forums AR Sandbox Forum External button for rain/drain

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2607
    Pseufei
    Participant

    Hello,
    I am thinking about adding two buttons for draining and raining instead of using keyboard. Do I need to use a microcontroller like raspberry pi to detect the button press or I can do that by modifying the file in AR sandbox? Can you give me some ideas of coding please?
    Thanks
    Faye

    #2612
    Sean Robinson
    Participant

    Oliver had a post on the old forum that uses an arcade USB encoder to send standard keyboard keys when the “arcade” buttons are pressed. He includes instructions for configuring the sandbox to use the buttons.

    The Wayback Machine has his post for “USB Button Solution”, but I cannot include the URL.

    Also, there are USB keyboards with one, two, five, etc. buttons. This way, the only sandbox setup is to assign tools (drain/rain) in the configuration file. I do not know how the output values are assigned to the keys, but I suspect it requires Windows for the initial setup.

    Another example is Liudr’s AR Sandbox controller. He gives instructions for building flood and drain buttons using an Arduino microcontroller.

    https://liudr.wordpress.com/2017/12/29/augmented-reality-sandbox-control-using-arduino-feather/

    #2702
    mattdc
    Participant

    I found the wayback machine post, and was wondering if anyone had a source for the specified code files: ScriptExecutorTool.h and ScriptExecutorTool.cpp

    https://shorturl.at/hjlAZ

    #2708
    Sean Robinson
    Participant

    @mattdc Thank you for adding the link. That’s the post I was referring to.

    It looks like the ScriptExecutorTool source files were added to Vrui
    after the 4.2 release. They can be found under the directory where the Vrui 8.0 source was unzipped, in Vrui/Tools/ScriptExecutorTool.h and
    Vrui/Tools/ScriptExecutorTool.cpp.

    #2712
    mattdc
    Participant

    Great, thanks for the update. I went ahead and wired up an arduino and some buttons. It seems to be working perfectly fine without crashing anything.

    #2740
    robbo
    Participant

    I just wanted to add my config file that I use with a simple arcade button USB Adaptor combo.

    section Vrui
        section Desktop
            section MouseAdapter
                mouseIdleTimeout 5.0
            endsection
    
           
            inputDeviceAdapterNames += (HIDAdapter)
           
            section HIDAdapter
                inputDeviceAdapterType HID
                inputDeviceNames (USBEncoder)
                
                section USBEncoder
                    name USBEncoder
                    deviceVendorProductId 0079:0006
                    trackingDeviceName Mouse
                endsection
            endsection
    
            section Window
                windowFullscreen false
            endsection
            
            section Tools
    
            toolClassNames += (ScriptExecutorTool)  
    
            section DefaultTools
                section WaterTool
                        toolClass GlobalWaterTool
                        bindings ((USBEncoder, Button0, Button1))
                    endsection
        
    
                endsection
            endsection
        endsection
    endsection
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.