OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 5 #ifndef VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
6 #define VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 6 #define VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
29 virtual bool Dispatch(const MSG& msg); | 29 virtual bool Dispatch(const MSG& msg); |
30 #else | 30 #else |
31 virtual bool Dispatch(GdkEvent* event); | 31 virtual bool Dispatch(GdkEvent* event); |
32 #endif | 32 #endif |
33 | 33 |
34 private: | 34 private: |
35 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
36 // The keys currently pressed and consumed by the FocusManager. | 36 // The keys currently pressed and consumed by the FocusManager. |
37 std::set<WPARAM> pressed_keys_; | 37 std::set<WPARAM> pressed_keys_; |
38 #else // OS_LINUX | |
39 // The set of hardware keycodes that are currently pressed. We use this | |
40 // to keep track of whether or not a key is being pressed in isolation | |
41 // or not. We must use hardware keycodes because higher-level keycodes | |
42 // may change between press and release depending on what modifier keys | |
43 // are pressed in the interim. | |
44 std::set<int> pressed_hardware_keys_; | |
45 // The set of vkey codes that were consumed by the FocusManager. | |
46 std::set<int> consumed_vkeys_; | |
47 // True if only the menu key (Alt key) was pressed, and no other keys. | |
48 bool only_menu_pressed_; | |
49 #endif | 38 #endif |
50 | 39 |
51 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); | 40 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); |
52 }; | 41 }; |
53 | 42 |
54 } // namespace views | 43 } // namespace views |
55 | 44 |
56 #endif // VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 45 #endif // VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
OLD | NEW |