GUIFormSpecMenu: Shift+Click listring workaround for MacOS
event.MouseInput.Shift is not implemented for MacOSmaster
parent
af073438fd
commit
e18b6c5a21
|
@ -4075,6 +4075,9 @@ enum ButtonEventType : u8
|
||||||
|
|
||||||
bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||||
{
|
{
|
||||||
|
// WORKAROUND: event.MouseInput.Shift is not implemented for MacOS
|
||||||
|
static thread_local bool is_shift_down = false;
|
||||||
|
|
||||||
if (event.EventType==EET_KEY_INPUT_EVENT) {
|
if (event.EventType==EET_KEY_INPUT_EVENT) {
|
||||||
KeyPress kp(event.KeyInput);
|
KeyPress kp(event.KeyInput);
|
||||||
if (event.KeyInput.PressedDown && (
|
if (event.KeyInput.PressedDown && (
|
||||||
|
@ -4084,6 +4087,8 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_shift_down = event.KeyInput.Shift;
|
||||||
|
|
||||||
if (m_client != NULL && event.KeyInput.PressedDown &&
|
if (m_client != NULL && event.KeyInput.PressedDown &&
|
||||||
(kp == getKeySetting("keymap_screenshot"))) {
|
(kp == getKeySetting("keymap_screenshot"))) {
|
||||||
m_client->makeScreenshot();
|
m_client->makeScreenshot();
|
||||||
|
@ -4133,6 +4138,9 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||||
event.MouseInput.isRightPressed() &&
|
event.MouseInput.isRightPressed() &&
|
||||||
getItemAtPos(m_pointer).i != getItemAtPos(m_old_pointer).i))) {
|
getItemAtPos(m_pointer).i != getItemAtPos(m_old_pointer).i))) {
|
||||||
|
|
||||||
|
// WORKAROUND: In case shift was pressed prior showing the formspec
|
||||||
|
is_shift_down |= event.MouseInput.Shift;
|
||||||
|
|
||||||
// Get selected item and hovered/clicked item (s)
|
// Get selected item and hovered/clicked item (s)
|
||||||
|
|
||||||
m_old_tooltip_id = -1;
|
m_old_tooltip_id = -1;
|
||||||
|
@ -4263,7 +4271,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||||
else // left
|
else // left
|
||||||
count = s_count;
|
count = s_count;
|
||||||
|
|
||||||
if (!event.MouseInput.Shift) {
|
if (!is_shift_down) {
|
||||||
// no shift: select item
|
// no shift: select item
|
||||||
m_selected_amount = count;
|
m_selected_amount = count;
|
||||||
m_selected_dragging = button != BET_WHEEL_DOWN;
|
m_selected_dragging = button != BET_WHEEL_DOWN;
|
||||||
|
|
Loading…
Reference in New Issue