mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'onmiddleclick' ui event
This commit is contained in:
parent
60106d4fb1
commit
44bdd57fe5
3 changed files with 4 additions and 0 deletions
|
|
@ -79,6 +79,8 @@ void UINode::click(int, int) {
|
||||||
void UINode::clicked(Mousecode button) {
|
void UINode::clicked(Mousecode button) {
|
||||||
if (button == Mousecode::BUTTON_2) {
|
if (button == Mousecode::BUTTON_2) {
|
||||||
actions.notify(UIAction::RIGHT_CLICK, gui);
|
actions.notify(UIAction::RIGHT_CLICK, gui);
|
||||||
|
} else if (button == Mousecode::BUTTON_3) {
|
||||||
|
actions.notify(UIAction::MIDDLE_CLICK, gui);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ namespace gui {
|
||||||
FOCUS,
|
FOCUS,
|
||||||
DEFOCUS,
|
DEFOCUS,
|
||||||
RIGHT_CLICK,
|
RIGHT_CLICK,
|
||||||
|
MIDDLE_CLICK,
|
||||||
MOUSE_OVER,
|
MOUSE_OVER,
|
||||||
MOUSE_OUT,
|
MOUSE_OUT,
|
||||||
MOUSE_ENTER,
|
MOUSE_ENTER,
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ static void read_uinode(
|
||||||
|
|
||||||
register_action(node, reader, element, "onclick", UIAction::CLICK);
|
register_action(node, reader, element, "onclick", UIAction::CLICK);
|
||||||
register_action(node, reader, element, "onrightclick", UIAction::RIGHT_CLICK);
|
register_action(node, reader, element, "onrightclick", UIAction::RIGHT_CLICK);
|
||||||
|
register_action(node, reader, element, "onmiddleclick", UIAction::MIDDLE_CLICK);
|
||||||
register_action(node, reader, element, "onfocus", UIAction::FOCUS);
|
register_action(node, reader, element, "onfocus", UIAction::FOCUS);
|
||||||
register_action(node, reader, element, "ondefocus", UIAction::DEFOCUS);
|
register_action(node, reader, element, "ondefocus", UIAction::DEFOCUS);
|
||||||
register_action(node, reader, element, "ondoubleclick", UIAction::DOUBLE_CLICK);
|
register_action(node, reader, element, "ondoubleclick", UIAction::DOUBLE_CLICK);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue