Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: Source/platform/PlatformEvent.h

Issue 727593003: Implement MouseEvent buttons attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: should be 0 in contextmenu event Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 TouchMove, 71 TouchMove,
72 TouchEnd, 72 TouchEnd,
73 TouchCancel, 73 TouchCancel,
74 }; 74 };
75 75
76 enum Modifiers { 76 enum Modifiers {
77 AltKey = 1 << 0, 77 AltKey = 1 << 0,
78 CtrlKey = 1 << 1, 78 CtrlKey = 1 << 1,
79 MetaKey = 1 << 2, 79 MetaKey = 1 << 2,
80 ShiftKey = 1 << 3, 80 ShiftKey = 1 << 3,
81
82 LeftButtonDown = 1 << 6,
83 MiddleButtonDown = 1 << 7,
84 RightButtonDown = 1 << 8,
Rick Byers 2014/11/28 17:36:02 By the way, with the addition of these, I believe
zino 2014/12/03 15:47:15 Done.
81 }; 85 };
82 86
83 Type type() const { return static_cast<Type>(m_type); } 87 Type type() const { return static_cast<Type>(m_type); }
84 88
85 bool shiftKey() const { return m_modifiers & ShiftKey; } 89 bool shiftKey() const { return m_modifiers & ShiftKey; }
86 bool ctrlKey() const { return m_modifiers & CtrlKey; } 90 bool ctrlKey() const { return m_modifiers & CtrlKey; }
87 bool altKey() const { return m_modifiers & AltKey; } 91 bool altKey() const { return m_modifiers & AltKey; }
88 bool metaKey() const { return m_modifiers & MetaKey; } 92 bool metaKey() const { return m_modifiers & MetaKey; }
89 93
90 unsigned modifiers() const { return m_modifiers; } 94 unsigned modifiers() const { return m_modifiers; }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 139 }
136 140
137 unsigned m_type; 141 unsigned m_type;
138 unsigned m_modifiers; 142 unsigned m_modifiers;
139 double m_timestamp; 143 double m_timestamp;
140 }; 144 };
141 145
142 } // namespace blink 146 } // namespace blink
143 147
144 #endif // PlatformEvent_h 148 #endif // PlatformEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698