Re: [AD] (OS X) mouse button number reported |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2008-09-18, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> As I mentioned previously, when I ran ex_events, the display would show the
> right mouse button lighting up when I clicked (with the one button I have).
> Investigating, there seems to be an inconsistency between how
> _al_osx_mouse_generate_event numbers the buttons starting from 1 and the
> way ex_events expects them to be ordered starting from 0.
Hmm? Buttons should be numbered from 1 everywhere, IIRC.
> Assuming that's also how they're numbered on other platforms, the attached
> patch fixes the problem. Please confirm that this is correct (although
> Peter Wang already more or less did that when he said the primary mouse
> button should highlight the left box).
>
> On a related issue, the same chunk of code in qzmouse records the change in
> a variable b_change, which is then used to set osx_mouse.state.buttons,
> which doesn't seem to be used again anywhere else (according to grep).
> However, b_change is only set when the key state changes to "down". Should
> this be fixed, or can the osx_mouse.state.buttons part be removed
> completely?
It's needed for osx_get_mouse_state, which implements
al_get_mouse_state(). So b_change should definitely be set when a mouse
button is raised.
The current broken behaviour ought to show up in ex_events.
Peter