2 * Copyright 2004-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
7 * John Scipione, jscipione@gmail.com
12 #include "KeymapApplication.h"
15 // #pragma mark - KeymapApplication
18 KeymapApplication::KeymapApplication()
20 BApplication("application/x-vnd.Haiku-Keymap"),
21 fModifierKeysWindow(NULL
)
24 fWindow
= new KeymapWindow();
30 KeymapApplication::MessageReceived(BMessage
* message
)
32 switch (message
->what
) {
33 case kMsgShowModifierKeysWindow
:
34 _ShowModifierKeysWindow();
36 case kMsgCloseModifierKeysWindow
:
37 fModifierKeysWindow
= NULL
;
39 case kMsgUpdateModifierKeys
:
40 fWindow
->PostMessage(message
);
44 BApplication::MessageReceived(message
);
49 KeymapApplication::_ShowModifierKeysWindow()
51 if (fModifierKeysWindow
!= NULL
)
52 fModifierKeysWindow
->Activate();
54 fModifierKeysWindow
= new ModifierKeysWindow();
55 fModifierKeysWindow
->CenterIn(fWindow
->Frame());
56 fModifierKeysWindow
->Show();
61 // #pragma mark - main method
67 new KeymapApplication
;