Implemented B_CLOSE_ON_ESCAPE as mentioned on the mailing list.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21308 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-06-03 19:23:03 +00:00
parent 708491da60
commit 288e17885a
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -82,6 +82,7 @@ enum {
B_QUIT_ON_WINDOW_CLOSE = 0x00100000,
B_SAME_POSITION_IN_ALL_WORKSPACES = 0x00200000,
B_AUTO_UPDATE_SIZE_LIMITS = 0x00400000,
B_CLOSE_ON_ESCAPE = 0x00800000
};
#define B_CURRENT_WORKSPACE 0
+9
View File
@@ -3138,6 +3138,15 @@ BWindow::_HandleKeyDown(BMessage* event)
return true;
}
// Optionally close window when the escape key is pressed
if (key == B_ESCAPE && (Flags() & B_CLOSE_ON_ESCAPE) != 0) {
BMessage message(B_QUIT_REQUESTED);
message.AddBool("shortcut", true);
PostMessage(&message);
return true;
}
// Handle shortcuts
if ((modifiers & B_COMMAND_KEY) != 0) {
// Command+q has been pressed, so, we will quit