diff --git a/src/kits/interface/ToolTipManager.cpp b/src/kits/interface/ToolTipManager.cpp index 4f43e65b3b..105767bd71 100644 --- a/src/kits/interface/ToolTipManager.cpp +++ b/src/kits/interface/ToolTipManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2009-2010, Axel Dörfler, axeld@pinc-software.de. * Copyright 2009, Stephan Aßmus . * All rights reserved. Distributed under the terms of the MIT License. */ @@ -42,6 +42,7 @@ public: virtual void FrameResized(float width, float height); virtual void MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage); + virtual void KeyDown(const char* bytes, int32 numBytes); void HideTip(); void ShowTip(); @@ -82,7 +83,7 @@ ToolTipView::~ToolTipView() void ToolTipView::AttachedToWindow() { - SetEventMask(B_POINTER_EVENTS, 0); + SetEventMask(B_POINTER_EVENTS | B_KEYBOARD_EVENTS, 0); fToolTip->AttachedToWindow(); } @@ -127,6 +128,14 @@ ToolTipView::MouseMoved(BPoint where, uint32 transit, } +void +ToolTipView::KeyDown(const char* bytes, int32 numBytes) +{ + if (!fToolTip->IsSticky()) + HideTip(); +} + + void ToolTipView::HideTip() {