add 'onrightclick' uinode event

This commit is contained in:
MihailRis
2025-11-14 00:33:57 +03:00
parent 645f150ff2
commit 1fd81da82e
4 changed files with 20 additions and 1 deletions
+11
View File
@@ -69,6 +69,11 @@ UINode* UINode::listenAction(const onaction& action) {
return this;
}
UINode* UINode::listenRightClick(const onaction& action) {
rightClickCallbacks.listen(action);
return this;
}
UINode* UINode::listenDoubleClick(const onaction& action) {
doubleClickCallbacks.listen(action);
return this;
@@ -88,6 +93,12 @@ void UINode::click(int, int) {
pressed = true;
}
void UINode::clicked(Mousecode button) {
if (button == Mousecode::BUTTON_2) {
rightClickCallbacks.notify(gui);
}
}
void UINode::doubleClick(int x, int y) {
pressed = true;
if (isInside(glm::vec2(x, y))) {