From 8ebbfab33351b883b5f18d3ca70eadf5d617d510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 20 Jun 2006 15:20:18 +0000 Subject: [PATCH] When the B_COMMAND key is pressed, the event will not be forwarded to the target handler anymore, no matter if a shortcut existed or not. This fixes bug #498. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17883 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 199ddb52d7..0d69c38d9e 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -2956,6 +2956,15 @@ BWindow::_SanitizeMessage(BMessage* message, BHandler* target, bool usePreferred } +/*! + Handles keyboard input before it gets forwarded to the target handler. + This includes shortcut evaluation, keyboard navigation, etc. + + \return handled if true, the event was already handled, and will not + be forwarded to the target handler. + + TODO: must also convert the incoming key to the font encoding of the target +*/ bool BWindow::_HandleKeyDown(char key, uint32 modifiers) { @@ -3033,8 +3042,10 @@ BWindow::_HandleKeyDown(char key, uint32 modifiers) } } - return true; } + + // we always eat the event if the command key was pressed + return true; } // TODO: convert keys to the encoding of the target view