* The mouse message now also contains the x/y delta, if available, in the

int32 fields "be:delta_x", and "be:delta_y".
* This way, you can discover if the mouse is moved against an edge or corner
  of the screen.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24662 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-03-29 17:46:01 +00:00
parent 77b6a3f51b
commit f2879f52a3

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Copyright 2002-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@ -920,10 +920,9 @@ InputServer::HandleFocusUnfocusIMAwareView(BMessage* message,
} }
/** Enqueues the message into the event queue. /*! Enqueues the message into the event queue.
* The message must only be deleted in case this method returns an error. The message must only be deleted in case this method returns an error.
*/ */
status_t status_t
InputServer::EnqueueDeviceMessage(BMessage* message) InputServer::EnqueueDeviceMessage(BMessage* message)
{ {
@ -941,10 +940,9 @@ InputServer::EnqueueDeviceMessage(BMessage* message)
} }
/** Enqueues the message into the method queue. /*! Enqueues the message into the method queue.
* The message must only be deleted in case this method returns an error. The message must only be deleted in case this method returns an error.
*/ */
status_t status_t
InputServer::EnqueueMethodMessage(BMessage* message) InputServer::EnqueueMethodMessage(BMessage* message)
{ {
@ -1032,8 +1030,7 @@ InputServer::EventLoopRunning()
} }
/** The fInputDeviceListLocker must be locked when calling this function */ /*! The fInputDeviceListLocker must be locked when calling this function */
InputDeviceListItem* InputDeviceListItem*
InputServer::_FindInputDeviceListItem(BInputServerDevice& device) InputServer::_FindInputDeviceListItem(BInputServerDevice& device)
{ {
@ -1387,11 +1384,10 @@ InputServer::_EventLoop()
} }
/** Frees events from unwanted fields, adds missing fields, and removes /*! Frees events from unwanted fields, adds missing fields, and removes
* unwanted events altogether. unwanted events altogether.
* As a side effect, it will also update the internal mouse states. As a side effect, it will also update the internal mouse states.
*/ */
bool bool
InputServer::_SanitizeEvents(EventList& events) InputServer::_SanitizeEvents(EventList& events)
{ {
@ -1447,6 +1443,8 @@ InputServer::_SanitizeEvents(EventList& events)
event->RemoveName("x"); event->RemoveName("x");
event->RemoveName("y"); event->RemoveName("y");
event->AddPoint("where", fMousePos); event->AddPoint("where", fMousePos);
event->AddInt32("be:delta_x", x);
event->AddInt32("be:delta_y", y);
PRINT(("new position: %f, %f, %ld, %ld\n", PRINT(("new position: %f, %f, %ld, %ld\n",
fMousePos.x, fMousePos.y, x, y)); fMousePos.x, fMousePos.y, x, y));
@ -1527,11 +1525,10 @@ InputServer::_SanitizeEvents(EventList& events)
} }
/** Applies the filters of the active input method to the /*! Applies the filters of the active input method to the
* incoming events. It will also move the events in the method incoming events. It will also move the events in the method
* queue to the event list. queue to the event list.
*/ */
bool bool
InputServer::_MethodizeEvents(EventList& events) InputServer::_MethodizeEvents(EventList& events)
{ {
@ -1620,13 +1617,12 @@ InputServer::_MethodizeEvents(EventList& events)
} }
/** This method applies all defined filters to each event in the /*! This method applies all defined filters to each event in the
* supplied list. The supplied list is modified to reflect the supplied list. The supplied list is modified to reflect the
* output of the filters. output of the filters.
* The method returns true if the filters were applied to all The method returns true if the filters were applied to all
* events without error and false otherwise. events without error and false otherwise.
*/ */
bool bool
InputServer::_FilterEvents(EventList& events) InputServer::_FilterEvents(EventList& events)
{ {
@ -1669,11 +1665,10 @@ InputServer::_DispatchEvents(EventList& events)
} }
/** Applies the given filter to the event list. /*! Applies the given filter to the event list.
* For your convenience, it also alters the \a index and \a count arguments For your convenience, it also alters the \a index and \a count arguments
* ready for the next call to this method. ready for the next call to this method.
*/ */
void void
InputServer::_FilterEvent(BInputServerFilter* filter, EventList& events, InputServer::_FilterEvent(BInputServerFilter* filter, EventList& events,
int32& index, int32& count) int32& index, int32& count)