core: Mouse buttons state integration #101
This allows users to use mousekey buttons with PS/2, ADB or Serial pointing device.
This commit is contained in:
parent
b981b8e266
commit
5f7d388dee
12 changed files with 86 additions and 0 deletions
|
|
@ -414,6 +414,11 @@ void adb_mouse_task(void)
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t adb_mouse_buttons(void)
|
||||
{
|
||||
return mouse_report.buttons;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
|
|
|
|||
|
|
@ -85,6 +85,14 @@ action_t action_for_key(uint8_t layer, keypos_t key)
|
|||
return (action_t){ .code = pgm_read_word(&actionmaps[(layer)][key.row & 0x07][key.col & 0x0F]) };
|
||||
}
|
||||
|
||||
#ifdef IBMPC_MOUSE_ENABLE
|
||||
static uint8_t last_buttons;
|
||||
uint8_t ibmpc_mouse_buttons(void)
|
||||
{
|
||||
return last_buttons;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void IBMPCConverter::set_led(uint8_t usb_led)
|
||||
{
|
||||
|
|
@ -607,6 +615,7 @@ MOUSE_DONE:
|
|||
mouse_report.v = -CHOP8(v);
|
||||
mouse_report.h = CHOP8(h);
|
||||
host_mouse_send(&mouse_report);
|
||||
last_buttons = mouse_report.buttons;
|
||||
xprintf("M[x:%d y:%d v:%d h:%d b:%02X]\n", mouse_report.x, mouse_report.y,
|
||||
mouse_report.v, mouse_report.h, mouse_report.buttons);
|
||||
break; }
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
#define ROW(code) ((code>>4)&0x07)
|
||||
#define COL(code) (code&0x0F)
|
||||
|
||||
#ifdef IBMPC_MOUSE_ENABLE
|
||||
extern "C" uint8_t ibmpc_mouse_buttons(void);
|
||||
#endif
|
||||
|
||||
|
||||
class IBMPCConverter {
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue