mouse: Replace press_state with bool pressed

Change the mouse_button structure to use a bool pressed field instead
of an unsigned char press_state. This simplifies the API by using a
natural boolean type for a binary state.

Remove the BUTTON_PRESSED/BUTTON_RELEASED defines as they're no longer
needed.

Update all mouse drivers, tests, and the mouse command to use the new
field name and type.

Series-changes: 2
- Add new patch to replace press_state with bool pressed

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-07 06:02:15 -06:00
parent 90964bf740
commit 03c65c2b94
7 changed files with 16 additions and 22 deletions

View File

@@ -35,7 +35,7 @@ static int do_mouse_dump(struct cmd_tbl *cmdtp, int flag, int argc,
struct mouse_button *but = &evt.button;
printf("button: button==%d, press=%d, clicks=%d, X=%d, Y=%d\n",
but->button, but->press_state,
but->button, but->pressed,
but->clicks, but->x, but->y);
break;
}