Home › Forums › AR Sandbox Forum › External button for rain/drain
Tagged: External buttons
- This topic has 6 replies, 4 voices, and was last updated 5 months ago by robbo.
-
AuthorPosts
-
August 22, 2023 at 9:02 am #2607PseufeiParticipant
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
FayeAugust 23, 2023 at 9:57 am #2612Sean RobinsonParticipantOliver 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/
January 9, 2024 at 8:44 am #2702mattdcParticipantI found the wayback machine post, and was wondering if anyone had a source for the specified code files: ScriptExecutorTool.h and ScriptExecutorTool.cpp
January 10, 2024 at 2:44 pm #2708Sean RobinsonParticipant@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, inVrui/Tools/ScriptExecutorTool.h
and
Vrui/Tools/ScriptExecutorTool.cpp
.January 19, 2024 at 11:16 am #2712mattdcParticipantGreat, 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.
June 21, 2024 at 12:20 pm #2740robboParticipantI 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
-
AuthorPosts
- You must be logged in to reply to this topic.