[interfacekit] Re: :) B_MOUSE_MOVED


> Think about it - what purpose might there be if a user were going to move the 
> mouse with the shift key down=3F While I'm a bit limited in my thinking, I 

Drag & drop with different modifiers might indikate different actions,
the application could visually change the cursor or do something else
to indicate what would happen if the dragged thing would be dropped.
This would be one purpose of checking modifiers when the mouse is moved.

> Likewise, it is currently possible to track the modifiers without calling 
> modifiers() or getting it from the message - cache it as a class member and 
> handle B=5FMODIFIERS=5FCHANGED in MessageReceived() to modify the cached 
> copy. 
> This could be done for any class which really needs to track the modifier 
> states.
Does really every BView get this message=3F I remember that I had exactly this 
problem, and wrote a BMessageFilter to track B=5FMODIFIERS=5FCHANGED
from inside a BView. Purpose was to notify a view about these changes.

filter=5Fresult
CLV=5FModifiers=5FMessageFilter::Filter(BMessage *message, BHandler **target)
{
        uint32 oldmod;
        uint32 newmod;
        message->FindInt32("be:old=5Fmodifiers", (int32 *)&oldmod);
        message->FindInt32("modifiers", (int32 *)&newmod);
        fView->ModifiersDown((oldmod ^ newmod) & newmod);
        fView->ModifiersUp((oldmod ^ newmod) & oldmod);
        return B=5FDISPATCH=5FMESSAGE;
}

The implementation that needed this was a column list view, which needs
to get the state of the modifiers at the mouse down event during the mouse
moved event (and some more complex usages, else I could have used modifiers() :)

> Lastly, a *very* good reason not to do it is to avoid feature creep. Michael, 
Ok

Marcus 

(whatever, we don't need it now, but if the input server generating the mouse 
events
already has the infomation (and doesn't need any other syscalls to get it), it 
might make
actually sense to add the field)




Other related posts: