Microtouch: add option to turn off visible mouse crosshair for people using touchscreens

This commit is contained in:
Jos van Mourik
2024-07-26 20:12:10 +02:00
parent 5a5fd566cf
commit 04a7a35f27
3 changed files with 11 additions and 2 deletions

View File

@@ -341,7 +341,7 @@ mtouch_init(const device_t *info)
timer_on_auto(&dev->host_to_serial_timer, (1000000. / dev->baud_rate) * 10);
dev->mode = MODE_TABLET;
dev->pen_mode = 3;
mouse_input_mode = 1;
mouse_input_mode = device_get_config_int("crosshair") + 1;
mouse_set_buttons(2);
mouse_set_poll_ex(mtouch_poll_global);
@@ -398,6 +398,13 @@ static const device_config_t mtouch_config[] = {
{ .description = "1200", .value = 1200 }
}
},
{
.name = "crosshair",
.description = "Show Crosshair",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};

View File

@@ -50,7 +50,7 @@ extern "C" {
#endif
extern int mouse_type;
extern int mouse_input_mode; /* 1 = Absolute, 0 = Relative */
extern int mouse_input_mode; /* 2 = Absolute (Visible Crosshair), 1 = Absolute, 0 = Relative */
extern int mouse_timed; /* 1 = Timed, 0 = Constant */
extern int mouse_tablet_in_proximity;
extern double mouse_x_abs;

View File

@@ -251,6 +251,8 @@ RendererStack::enterEvent(QEvent *event)
mousedata.mouse_tablet_in_proximity = m_monitor_index + 1;
if (mouse_input_mode == 1)
QApplication::setOverrideCursor(Qt::BlankCursor);
else if (mouse_input_mode == 2)
QApplication::setOverrideCursor(Qt::CrossCursor);
}