Start a new topic

Snap Button


I've successfully added a virtual button that when clicked snaps the AR overlay onto the screen. I used the following bit of code. 


   var imgSnap2 = new AR.ImageResource("assets/snapButton.png", {
                    onError: World.onError
                this.buttonSnap2 = new AR.ImageDrawable(imgSnap2, 0.1, {
                    translate: {
                        x: -0.27,
                        y: -0.01
                    onClick: World.toggleSnapping2



I want to replace the virtual button with a physical button on the device I'm using. The physical button is on the trackpad of Epson BT-300 smartglasses. The name of the button is the following. 


Is it possible to amend the code above to achieve this? 



1 Comment

Hi Alan,

You would need to handle the onclick event of the physical button in the native part, and then use the ArchitectView.callJavascript() method to use something that is declared in the javascript part as the World.toggleSnapping2 that you mentioned.

Here: is the API reference for the native part.

Thank you,


Login or Signup to post a comment