rename mouse handler and remove all references to evdev

virtual-keyboard-mouse
nirenjan 2026-03-27 08:32:12 -07:00
parent d1bdafb46d
commit 874b98fcca
5 changed files with 22 additions and 22 deletions

View File

@ -330,7 +330,7 @@ int main(int argc, char **argv)
}
x52d_notify_init(notify_sock);
x52d_io_init();
x52d_mouse_evdev_init();
x52d_mouse_handler_init();
// Re-enable signals
rc = pthread_sigmask(SIG_UNBLOCK, &sigblockset, NULL);
@ -369,7 +369,7 @@ cleanup:
x52d_dev_exit();
x52d_command_exit();
x52d_notify_exit();
x52d_mouse_evdev_exit();
x52d_mouse_handler_exit();
x52d_io_exit();
// Remove the PID file

View File

@ -30,7 +30,7 @@ void x52d_cfg_set_Mouse_Enabled(bool enabled)
{
PINELOG_DEBUG(_("Setting mouse enable to %s"),
enabled ? _("on") : _("off"));
x52d_mouse_evdev_thread_control(enabled);
x52d_mouse_thread_control(enabled);
}
void x52d_cfg_set_Mouse_Speed(int speed)

View File

@ -18,9 +18,9 @@ extern volatile int mouse_scroll_dir;
#define MOUSE_MULT_FACTOR 4
void x52d_mouse_evdev_thread_control(bool enabled);
void x52d_mouse_evdev_init(void);
void x52d_mouse_evdev_exit(void);
void x52d_mouse_thread_control(bool enabled);
void x52d_mouse_handler_init(void);
void x52d_mouse_handler_exit(void);
void x52d_mouse_report_event(libx52io_report *report);
#endif // !defined X52D_MOUSE_H

View File

@ -39,9 +39,9 @@ static int report_button_change(vkm_mouse_button button, int index)
if (old_button != new_button) {
state = new_button ? VKM_BUTTON_PRESSED : VKM_BUTTON_RELEASED;
rc = vkm_mouse_click(mouse_context, button, state);
if (rc != VKM_SUCCESS) {
PINELOG_ERROR(_("Error writing mouse button event (button %d, state %d)"),
button, (int)new_button);
if (rc != VKM_SUCCESS && rc != VKM_ERROR_NO_CHANGE) {
PINELOG_ERROR(_("Error %d writing mouse button event (button %d, state %d)"),
rc, button, (int)new_button);
}
}
@ -116,9 +116,9 @@ static int report_axis(void)
int dy = get_axis_val(LIBX52IO_AXIS_THUMBY);
rc = vkm_mouse_move(mouse_context, dx, dy);
if (rc != VKM_SUCCESS) {
PINELOG_ERROR(_("Error writing mouse axis event (dx %d, dy %d)"),
dx, dy);
if (rc != VKM_SUCCESS && rc != VKM_ERROR_NO_CHANGE) {
PINELOG_ERROR(_("Error %d writing mouse axis event (dx %d, dy %d)"),
rc, dx, dy);
}
return (rc == VKM_SUCCESS);
@ -178,7 +178,7 @@ static void x52d_mouse_thr_exit(void)
pthread_cancel(mouse_thr);
}
void x52d_mouse_evdev_thread_control(bool enabled)
void x52d_mouse_thread_control(bool enabled)
{
if (!vkm_is_ready(mouse_context)) {
PINELOG_INFO(_("Virtual mouse not created. Ignoring thread state change"));
@ -227,7 +227,7 @@ void x52d_mouse_report_event(libx52io_report *report)
}
}
void x52d_mouse_evdev_init(void)
void x52d_mouse_handler_init(void)
{
vkm_result rc;
@ -245,9 +245,9 @@ void x52d_mouse_evdev_init(void)
}
}
void x52d_mouse_evdev_exit(void)
void x52d_mouse_handler_exit(void)
{
x52d_mouse_evdev_thread_control(false);
x52d_mouse_thread_control(false);
vkm_exit(mouse_context);
mouse_context = NULL;
}

View File

@ -19,8 +19,8 @@
#include "x52d_const.h"
#include "x52d_mouse.h"
/* Stub for evdev */
void x52d_mouse_evdev_thread_control(bool enabled)
/* Stub for handler */
void x52d_mouse_thread_control(bool enabled)
{
function_called();
check_expected(enabled);
@ -29,8 +29,8 @@ void x52d_mouse_evdev_thread_control(bool enabled)
static void test_mouse_thread_enabled(void **state)
{
(void)state;
expect_function_calls(x52d_mouse_evdev_thread_control, 1);
expect_value(x52d_mouse_evdev_thread_control, enabled, true);
expect_function_calls(x52d_mouse_thread_control, 1);
expect_value(x52d_mouse_thread_control, enabled, true);
x52d_cfg_set_Mouse_Enabled(true);
}
@ -38,8 +38,8 @@ static void test_mouse_thread_enabled(void **state)
static void test_mouse_thread_disabled(void **state)
{
(void)state;
expect_function_calls(x52d_mouse_evdev_thread_control, 1);
expect_value(x52d_mouse_evdev_thread_control, enabled, false);
expect_function_calls(x52d_mouse_thread_control, 1);
expect_value(x52d_mouse_thread_control, enabled, false);
x52d_cfg_set_Mouse_Enabled(false);
}