From 6ca68635e8cef8407e91bc9542edf196ef708210 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 17 Dec 2021 10:43:11 -0500 Subject: Make button numbers consistent across platforms There's no universal consensus on how buttons are numbered. Left, right, middle as 0, 1, 2 seems to be the most common convention on modern vaguely similar libraries, so I've gone with that. The switch to zero-based indices will obviously break all current client code. Particularly since now is the time to finish any breaking changes before a stable release, I think that is better than only changing the middle and right numbers, which would likely go unnoticed. --- src/mac.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mac.m') diff --git a/src/mac.m b/src/mac.m index 5a10964..84530b4 100644 --- a/src/mac.m +++ b/src/mac.m @@ -448,7 +448,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type) rloc.x, [[NSScreen mainScreen] frame].size.height - rloc.y, getModifiers(event), - (uint32_t)[event buttonNumber] + 1, + (uint32_t)[event buttonNumber], }; PuglEvent pressEvent; @@ -469,7 +469,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type) rloc.x, [[NSScreen mainScreen] frame].size.height - rloc.y, getModifiers(event), - (uint32_t)[event buttonNumber] + 1, + (uint32_t)[event buttonNumber], }; PuglEvent releaseEvent; -- cgit v1.2.1