pen: Added Cocoa backend.

This commit is contained in:
Ryan C. Gordon
2024-08-09 02:27:37 -04:00
parent a9d70dbacb
commit b4ca15b654
8 changed files with 248 additions and 2 deletions

View File

@@ -171,7 +171,7 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event)
/*SDL_Log("Pen %" SDL_PRIu32 " button %d down!", event->pbutton.which, (int) event->pbutton.button);*/
pen = FindPen(event->ptouch.which);
if (pen) {
pen->buttons |= (1 << event->pbutton.button);
pen->buttons |= (1 << (event->pbutton.button-1));
}
return SDL_APP_CONTINUE;
@@ -179,7 +179,7 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event)
/*SDL_Log("Pen %" SDL_PRIu32 " button %d up!", event->pbutton.which, (int) event->pbutton.button);*/
pen = FindPen(event->ptouch.which);
if (pen) {
pen->buttons &= ~(1 << event->pbutton.button);
pen->buttons &= ~(1 << (event->pbutton.button-1));
}
return SDL_APP_CONTINUE;