Added ModifiersChanged() hook to Window and [Default]WindowBehavior.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39622 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -859,6 +859,12 @@ DefaultWindowBehaviour::MouseMoved(BMessage *message, BPoint where, bool isFake)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DefaultWindowBehaviour::ModifiersChanged(int32 modifiers)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DefaultWindowBehaviour::_IsWindowModifier(int32 modifiers) const
|
DefaultWindowBehaviour::_IsWindowModifier(int32 modifiers) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public:
|
|||||||
virtual void MouseMoved(BMessage *message, BPoint where,
|
virtual void MouseMoved(BMessage *message, BPoint where,
|
||||||
bool isFake);
|
bool isFake);
|
||||||
|
|
||||||
|
virtual void ModifiersChanged(int32 modifiers);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum Region {
|
enum Region {
|
||||||
REGION_NONE,
|
REGION_NONE,
|
||||||
|
|||||||
@@ -490,6 +490,19 @@ Desktop::BroadcastToAllWindows(int32 code)
|
|||||||
void
|
void
|
||||||
Desktop::KeyEvent(uint32 what, int32 key, int32 modifiers)
|
Desktop::KeyEvent(uint32 what, int32 key, int32 modifiers)
|
||||||
{
|
{
|
||||||
|
if (LockAllWindows()) {
|
||||||
|
Window* window = MouseEventWindow();
|
||||||
|
if (window == NULL)
|
||||||
|
window = WindowAt(fLastMousePosition);
|
||||||
|
|
||||||
|
if (window != NULL) {
|
||||||
|
if (what == B_MODIFIERS_CHANGED)
|
||||||
|
window->ModifiersChanged(modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
UnlockAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
NotifyKeyPressed(what, key, modifiers);
|
NotifyKeyPressed(what, key, modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -867,6 +867,13 @@ Window::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Window::ModifiersChanged(int32 modifiers)
|
||||||
|
{
|
||||||
|
fWindowBehaviour->ModifiersChanged(modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
@@ -1046,7 +1053,7 @@ Window::SetTabLocation(float location, BRegion& dirty)
|
|||||||
{
|
{
|
||||||
if (fDecorator)
|
if (fDecorator)
|
||||||
return fDecorator->SetTabLocation(location, &dirty);
|
return fDecorator->SetTabLocation(location, &dirty);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ public:
|
|||||||
int32* _viewToken, bool isLatestMouseMoved,
|
int32* _viewToken, bool isLatestMouseMoved,
|
||||||
bool isFake);
|
bool isFake);
|
||||||
|
|
||||||
|
void ModifiersChanged(int32 modifiers);
|
||||||
|
|
||||||
// some hooks to inform the client window
|
// some hooks to inform the client window
|
||||||
// TODO: move this to ServerWindow maybe?
|
// TODO: move this to ServerWindow maybe?
|
||||||
void WorkspaceActivated(int32 index, bool active);
|
void WorkspaceActivated(int32 index, bool active);
|
||||||
|
|||||||
@@ -15,11 +15,15 @@ WindowBehaviour::WindowBehaviour()
|
|||||||
fIsResizing(false),
|
fIsResizing(false),
|
||||||
fIsDragging(false)
|
fIsDragging(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WindowBehaviour::~WindowBehaviour()
|
WindowBehaviour::~WindowBehaviour()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WindowBehaviour::ModifiersChanged(int32 modifiers)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public:
|
|||||||
virtual void MouseMoved(BMessage *message, BPoint where,
|
virtual void MouseMoved(BMessage *message, BPoint where,
|
||||||
bool isFake) = 0;
|
bool isFake) = 0;
|
||||||
|
|
||||||
|
virtual void ModifiersChanged(int32 modifiers);
|
||||||
|
|
||||||
bool IsDragging() const { return fIsDragging; }
|
bool IsDragging() const { return fIsDragging; }
|
||||||
bool IsResizing() const { return fIsResizing; }
|
bool IsResizing() const { return fIsResizing; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user