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 #include "chrome/views/event.h" | 5 #include "chrome/views/event.h" |
6 | 6 |
7 #include "chrome/views/view.h" | 7 #include "chrome/views/view.h" |
8 #include "webkit/glue/webinputevent.h" | 8 #include "webkit/glue/webinputevent.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 from, | 72 from, |
73 to) { | 73 to) { |
74 }; | 74 }; |
75 | 75 |
76 MouseEvent::MouseEvent(const MouseEvent& model, View* from, View* to) | 76 MouseEvent::MouseEvent(const MouseEvent& model, View* from, View* to) |
77 : LocatedEvent(model, from, to) { | 77 : LocatedEvent(model, from, to) { |
78 } | 78 } |
79 | 79 |
80 int KeyEvent::GetKeyStateFlags() const { | 80 int KeyEvent::GetKeyStateFlags() const { |
81 // Windows Keyboard messages don't come with control key state as parameters | 81 // Windows Keyboard messages don't come with control key state as parameters |
82 // like mouse messages do, so we need to explicitly probe for these key states
. | 82 // like mouse messages do, so we need to explicitly probe for these key |
| 83 // states. |
83 int flags = 0; | 84 int flags = 0; |
84 if (GetKeyState(VK_MENU) & 0x80) | 85 if (GetKeyState(VK_MENU) & 0x80) |
85 flags |= Event::EF_ALT_DOWN; | 86 flags |= Event::EF_ALT_DOWN; |
86 if (GetKeyState(VK_SHIFT) & 0x80) | 87 if (GetKeyState(VK_SHIFT) & 0x80) |
87 flags |= Event::EF_SHIFT_DOWN; | 88 flags |= Event::EF_SHIFT_DOWN; |
88 if (GetKeyState(VK_CONTROL) & 0x80) | 89 if (GetKeyState(VK_CONTROL) & 0x80) |
89 flags |= Event::EF_CONTROL_DOWN; | 90 flags |= Event::EF_CONTROL_DOWN; |
90 return flags; | 91 return flags; |
91 } | 92 } |
92 | 93 |
93 bool KeyEvent::IsExtendedKey() const { | 94 bool KeyEvent::IsExtendedKey() const { |
94 return (message_flags_ & KF_EXTENDED) == KF_EXTENDED; | 95 return (message_flags_ & KF_EXTENDED) == KF_EXTENDED; |
95 } | 96 } |
96 | 97 |
97 } // namespace views | 98 } // namespace views |
98 | 99 |
OLD | NEW |