-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Tabs
node's right_button_pressed
signal doesn't fire
#64498
Comments
"right button" does not mean right-click but "button on the right side of the text" which is only used in godot editor gui and not accessible from gdscript. This feature is used as ThemeEditor's close button for example: In my opinion, the behavior mentioned in the documentation would be more natural:
|
I see now where the Q&A's OP got the impression that the signal is only used internally in the engine. In other words, this issue is based on a misunderstanding. I suppose, then, there is no ready-to-use solution to check for right mouse-button clicks on a tab. |
right-click detection example (might not work if tabs are scaled or rotated):
|
Thank you, @heppocogne! I've tried your solution and it works! I suppose this issue can be closed due to it not actually being a bug but more of a documentation mix-up. Whether this warrants a change in the docs is a different question. |
Fixed by #64707. |
Godot version
3.4.2-stable, 3.4.4-stable, 3.5-stable
System information
Ubuntu 22.04
Issue description
I'm posting this there since I'm assuming this isn't intended behaviour for the 3.x branch, and it appears this hasn't been reported as an issue yet. I'm aware this is probably fixed by #58687 in 4.0. The only other reference I've found is an old Q&A post where OP states the signal is there for internal reasons.
The issue at hand: After connecting a method to the
Tabs
node'sright_button_pressed
signal, the method bound to the signal is not triggered when right-clicking on a tab, which would be necessary to intercept right mouse button clicks to individual tabs. I've noticed this while trying to figure out how to add a GUI feature to an open-source application.A partial workaround could be using
gui_input()
instead (though without easily accessible info on tabs). Variously queryingInput
for mouse button presses or releases within a method connected to thetab_clicked
does not yield any positive results.Steps to reproduce
Tabs
node in a new scene with arect_min_size
large enough to display at least two tabs.add_tab("..")
twice in_ready
.right_button_pressed
signal to a method.Minimal reproduction project
Tabs_RMBSignal_Reproduction.zip
The text was updated successfully, but these errors were encountered: