diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-07-10 13:26:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 13:26:43 +0200 |
commit | 48471ee0995061ea8c8b5957db905fcf31cd8682 (patch) | |
tree | f2ddf3bbed07bd7eee08b1809d1e0b9d3edb3b52 /core/os | |
parent | 3eb25ac3fbea09817ef28354f58ba55d2ecd1a6d (diff) | |
parent | 9cc41a59ac579b3676a832ebc4f1c865413897ce (diff) |
Merge pull request #20049 from moiman100/extra-mouse-buttons
Added support for extra mouse buttons.
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/input_event.cpp | 12 | ||||
-rw-r--r-- | core/os/input_event.h | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 4ebb821a2f..ca6446d015 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -509,6 +509,12 @@ String InputEventMouseButton::as_text() const { case BUTTON_WHEEL_RIGHT: button_index_string = "BUTTON_WHEEL_RIGHT"; break; + case BUTTON_XBUTTON1: + button_index_string = "BUTTON_XBUTTON1"; + break; + case BUTTON_XBUTTON2: + button_index_string = "BUTTON_XBUTTON2"; + break; default: button_index_string = itos(get_button_index()); break; @@ -601,6 +607,12 @@ String InputEventMouseMotion::as_text() const { case BUTTON_MASK_RIGHT: button_mask_string = "BUTTON_MASK_RIGHT"; break; + case BUTTON_MASK_XBUTTON1: + button_mask_string = "BUTTON_MASK_XBUTTON1"; + break; + case BUTTON_MASK_XBUTTON2: + button_mask_string = "BUTTON_MASK_XBUTTON2"; + break; default: button_mask_string = itos(get_button_mask()); break; diff --git a/core/os/input_event.h b/core/os/input_event.h index 037649ed60..bd1a85ce29 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -53,10 +53,13 @@ enum ButtonList { BUTTON_WHEEL_DOWN = 5, BUTTON_WHEEL_LEFT = 6, BUTTON_WHEEL_RIGHT = 7, + BUTTON_XBUTTON1 = 8, + BUTTON_XBUTTON2 = 9, BUTTON_MASK_LEFT = (1 << (BUTTON_LEFT - 1)), BUTTON_MASK_RIGHT = (1 << (BUTTON_RIGHT - 1)), BUTTON_MASK_MIDDLE = (1 << (BUTTON_MIDDLE - 1)), - + BUTTON_MASK_XBUTTON1 = (1 << (BUTTON_XBUTTON1 - 1)), + BUTTON_MASK_XBUTTON2 = (1 << (BUTTON_XBUTTON2 - 1)) }; enum JoystickList { |