* avoid key highlighting unless the preflet window is active, at least

I've found it pretty silly that the Keymap preflet would document all my
  keypresses although I'm doing something elsewhere

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30745 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2009-05-13 13:49:00 +00:00
parent 4b74bbf276
commit d47410e075
2 changed files with 11 additions and 3 deletions
+10 -2
View File
@@ -108,6 +108,13 @@ KeyboardLayoutView::FrameResized(float width, float height)
}
void
KeyboardLayoutView::WindowActivated(bool active)
{
if (active)
Invalidate();
}
BSize
KeyboardLayoutView::MinSize()
{
@@ -482,7 +489,8 @@ KeyboardLayoutView::MessageReceived(BMessage* message)
&& fModifiers != newModifiers) {
fModifiers = newModifiers;
_EvaluateDropTarget(fDropPoint);
Invalidate();
if (Window()->IsActive())
Invalidate();
}
break;
}
@@ -947,7 +955,7 @@ KeyboardLayoutView::_KeyChanged(const BMessage* message)
uint8 diff = fKeyState[i] ^ state[i];
fKeyState[i] = state[i];
if (!checkSingle)
if (!checkSingle || !Window()->IsActive())
continue;
for (int32 j = 7; diff != 0; j--, diff >>= 1) {
+1 -1
View File
@@ -43,7 +43,7 @@ protected:
virtual void Draw(BRect updateRect);
virtual void MessageReceived(BMessage* message);
virtual void WindowActivated(bool active);
private:
enum key_kind {
kNormalKey,