(Solved) Message structure of GM_HANDLESCROLL ?
Posted: Thu Feb 11, 2016 5:52 pm
What is the message structure GM_HANDLESCROLL receives in a BOOPSI class dispatcher ?
Support Forum
https://forum.hyperion-entertainment.com/
https://forum.hyperion-entertainment.com/viewtopic.php?t=3344
Code: Select all
case IDCMP_EXTENDEDMOUSE:
code = intuiMsg->Code;
qual = intuiMsg->Qualifier;
// check that mouse is over the window and ignore if not
if ((intuiMsg->MouseX < 0) ||
(intuiMsg->MouseX > win->Window->Width) ||
(intuiMsg->MouseY < 0) ||
(intuiMsg->MouseY > win->Window->Height))
{
break;
}
wheelData = (struct IntuiWheelData *)intuiMsg->IAddress;
if ((code == IMSGCODE_INTUIWHEELDATA) && (wheelData != NULL))
{
deltaY = wheelData->WheelY;
}
(etc)
Heres an incomplete fragment from a HandleInpt function.that should give a hint as to how to procede.TSK wrote:So it's struct gpInput. But how do I get how much wheel was rotated and to which direction ?
Code: Select all
switch(gpi->gpi_IEvent->ie_Class)
{
#if defined(__amigaos4__)
case IECLASS_MOUSEWHEEL:
{
if(gpi->gpi_IEvent->ie_Qualifier & (IEQUALIFIER_RSHIFT | IEQUALIFIER_LSHIFT))
{
igd->igd_Top += gpi->gpi_IEvent->ie_Y * ((struct Gadget *)o)->Height;
}
else
{
igd->igd_Top += gpi->gpi_IEvent->ie_Y * 8;
}
if(igd->igd_Top < 0)
{
igd->igd_Top = 0;
}
if(igd->igd_Top + ((struct Gadget *)o)->Height > igd->igd_Height)
{
igd->igd_Top = igd->igd_Height - ((struct Gadget *)o)->Height;
}
}
}
retval = GMR_MEACTIVE;
}
break;
#endif
Definetly if you need to write a gadget that supports scrolling via the mouse wheel when being hovered over and not actually the active gadget.tonyw wrote:Is that the best way to do it?