Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The newly added content will be overwritten. Right click function? #288

Open
lanjiajie1 opened this issue Mar 17, 2023 · 2 comments
Open

Comments

@lanjiajie1
Copy link

The newly added content will be overwritten. Right click function?

@gamerscomplete
Copy link

gamerscomplete commented Mar 17, 2023

To detect when the right mouse button is clicked use subscribe on mouse down. Right click is button 1

app.SubscribeID(window.OnMouseDown, a, func(evname string, ev interface{}) {
    if me, found := ev.(*window.MouseEvent); found {
        if me.Button = 1 {
            fmt.Println("RIght mouse clicked")
        }
    }
})

You can see it being used here https://github.com/g3n/g3nd/blob/master/demos/other/raycast.go#L160

If you need help with G3N you should join the discord as there is more people to help there.

@lanjiajie1
Copy link
Author

要检测何时单击鼠标右键,请在按下鼠标时使用订阅。右键单击是按钮 1

app.SubscribeID(window.OnMouseDown, a, func(evname string, ev interface{}) {
    if me, found := ev.(*window.MouseEvent); found {
        if me.Button = 1 {
            fmt.Println("RIght mouse clicked")
        }
    }
})

你可以在这里看到它被使用https://github.com/g3n/g3nd/blob/master/demos/other/raycast.go#L160

如果你需要 G3N 的帮助,你应该加入 discord,因为那里有更多的人可以提供帮助。

This is not the problem. Panel coverage has been resolved. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants