[Ohrrpgce] SVN: teeemcee/8621 gfx_sdl: Add mouse wheel up/down as mouse buttons.

Ralph Versteegen teeemcee at gmail.com
Sat Apr 8 19:19:09 PDT 2017


Hahah.
It seems SDL 1.2 can't tell you the distance the wheel scrolled, especially
since that also depends on OS sensitivity settings, which is why they
rewrote how it works. Plus SDL2 supports scrolling on a touch screen.
At a low level, mice might well return button presses.

I've been wanting to add mouse wheel support in some places in Custom for a
long time.

On 9 April 2017 at 14:01, James Paige <Bob at hamsterrepublic.com> wrote:

> I am surprised!
>
> Both that this wasn't already supported, and that the wheel-as-buttons
> thing was an SDL 1.2 thing. I had mistakenly assumed that the wheel was
> buttons at a hardware level
>
> I learn something new every day!
>
> (And forget 4/5ths of it every night!)
>
>
> On Saturday, April 8, 2017, Ralph Versteegen <teeemcee at gmail.com> wrote:
>
>>
>>
>> On 9 April 2017 at 11:12, <subversion at hamsterrepublic.com> wrote:
>>
>>> teeemcee
>>> 2017-04-08 16:12:25 -0700 (Sat, 08 Apr 2017)
>>> 222
>>> gfx_sdl: Add mouse wheel up/down as mouse buttons.
>>>
>>> Also allow checking these buttons using "mouse button" and "mouse click",
>>> but it's undocumented, because other backends don't support it yet.
>>> Added a test to collider.rpg
>>> ---
>>> U   wip/gfx_sdl.bas
>>> U   wip/scancodes.bi
>>> U   wip/scriptcommands.bas
>>> U   wip/testgame/collider.hss
>>> U   wip/testgame/collider.rpg
>>>
>>
>> Wait, this isn't right. In fact, gfx_sdl was the only backend that didn't
>> support the mouse wheel! All other backends return the amount it moved, so
>> I'll change gfx_sdl to do the same. Then allmodex can translate that into
>> up/down button presses for people who want that.
>> And anyway, SDL 2 no longer reports the mouse wheel as a pair of buttons
>> like SDL 1.2. Instead it reports the amount the wheel moved.
>>
>>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20170409/8a8be2e7/attachment.htm>


More information about the Ohrrpgce mailing list