From e35e003bbf120a678c3b7ade58cf52b6079df69a Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Tue, 18 Jul 2017 23:15:43 +0200
Subject: [PATCH] Fix window behavior if default button is present.
* Almost all Enter keystrokes were hijacked without the ability to
reconfigure.
* Let apps use these shortcuts.
---
src/kits/interface/Window.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp
index 4be291ad68..4d10cbc225 100644
a
|
b
|
BWindow::_DetermineTarget(BMessage* message, BHandler* target)
|
3324 | 3324 | { |
3325 | 3325 | // if we have a default button, it might want to hear |
3326 | 3326 | // about pressing the <enter> key |
| 3327 | const int32 kNonLockModifierKeys = B_SHIFT_KEY | B_COMMAND_KEY |
| 3328 | | B_CONTROL_KEY | B_OPTION_KEY | B_MENU_KEY; |
3327 | 3329 | int32 rawChar; |
3328 | 3330 | if (DefaultButton() != NULL |
3329 | 3331 | && message->FindInt32("raw_char", &rawChar) == B_OK |
3330 | | && rawChar == B_ENTER) |
| 3332 | && rawChar == B_ENTER |
| 3333 | && (modifiers() & kNonLockModifierKeys) == 0) |
3331 | 3334 | return DefaultButton(); |
3332 | 3335 | |
3333 | 3336 | // supposed to fall through |