(Solved) Message structure of GM_HANDLESCROLL ?
- TSK
- Beta Tester
- Posts: 225
- Joined: Mon Dec 20, 2010 1:15 pm
- Location: Home land of Santa C., sauna, sisu and salmiakki
(Solved) Message structure of GM_HANDLESCROLL ?
What is the message structure GM_HANDLESCROLL receives in a BOOPSI class dispatcher ?
Last edited by TSK on Fri Feb 12, 2016 5:10 pm, edited 1 time in total.
Keep the party going !
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Message structure of GM_HANDLESCROLL ?
Same as GM_HANDLEINPUT GM_GOACTIVE etc
- TSK
- Beta Tester
- Posts: 225
- Joined: Mon Dec 20, 2010 1:15 pm
- Location: Home land of Santa C., sauna, sisu and salmiakki
Re: Message structure of GM_HANDLESCROLL ?
So it's struct gpInput. But how do I get how much wheel was rotated and to which direction ?
Keep the party going !
- tonyw
- AmigaOS Core Developer
- Posts: 1479
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: Message structure of GM_HANDLESCROLL ?
Is that the best way to do it?
I use the IDCMP Hook function and collect IDCMP_EXTENDEDMOUSE messages. They appear as a struct IntuiMsg, which gives the data like this:
I use the IDCMP Hook function and collect IDCMP_EXTENDEDMOUSE messages. They appear as a struct IntuiMsg, which gives the data like this:
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)
cheers
tony
tony
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Message structure of GM_HANDLESCROLL ?
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
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Message structure of GM_HANDLESCROLL ?
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?
If you are writing an app that needs to scroll an area independant of mouse posistion, then you way is good too.
- TSK
- Beta Tester
- Posts: 225
- Joined: Mon Dec 20, 2010 1:15 pm
- Location: Home land of Santa C., sauna, sisu and salmiakki
Re: Message structure of GM_HANDLESCROLL ?
@broadblues, tonyw
I got it working. I forgot I had the related code in my input handler already.
Thanks both of you !
I got it working. I forgot I had the related code in my input handler already.
Thanks both of you !
Keep the party going !