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

Side by Side Diff: ui/events/cocoa/cocoa_event_utils.h

Issue 2439953005: Support NSFlagsChanged in ui::EventFromNative. (Closed)
Patch Set: Unify NSFlagsChanged handling between content and ui/events. Created 4 years, 1 month 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 UI_EVENTS_COCOA_COCOA_EVENT_UTILS_H_ 5 #ifndef UI_EVENTS_COCOA_COCOA_EVENT_UTILS_H_
6 #define UI_EVENTS_COCOA_COCOA_EVENT_UTILS_H_ 6 #define UI_EVENTS_COCOA_COCOA_EVENT_UTILS_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "ui/events/events_export.h" 10 #include "ui/events/events_export.h"
11 11
12 namespace ui { 12 namespace ui {
13 13
14 // Conversion between wheel delta amounts and number of pixels to scroll. 14 // Conversion between wheel delta amounts and number of pixels to scroll.
15 constexpr double kScrollbarPixelsPerCocoaTick = 40.0; 15 constexpr double kScrollbarPixelsPerCocoaTick = 40.0;
16 16
17 // Converts the Cocoa |modifiers| bitsum into a ui::EventFlags bitsum. 17 // Converts the Cocoa |modifiers| bitsum into a ui::EventFlags bitsum.
18 EVENTS_EXPORT int EventFlagsFromModifiers(NSUInteger modifiers); 18 EVENTS_EXPORT int EventFlagsFromModifiers(NSUInteger modifiers);
19 19
20 // Retrieves a bitsum of ui::EventFlags represented by |event|, 20 // Retrieves a bitsum of ui::EventFlags represented by |event|,
21 // but instead use the modifier flags given by |modifiers|, 21 // but instead use the modifier flags given by |modifiers|,
22 // which is the same format as |-NSEvent modifierFlags|. This allows 22 // which is the same format as |-NSEvent modifierFlags|. This allows
23 // substitution of the modifiers without having to create a new event from 23 // substitution of the modifiers without having to create a new event from
24 // scratch. 24 // scratch.
25 EVENTS_EXPORT int EventFlagsFromNSEventWithModifiers(NSEvent* event, 25 EVENTS_EXPORT int EventFlagsFromNSEventWithModifiers(NSEvent* event,
26 NSUInteger modifiers); 26 NSUInteger modifiers);
27
28 // Returns true for |NSKeyUp| and for |NSFlagsChanged| when modifier key was
29 // released.
30 EVENTS_EXPORT bool IsKeyUpEvent(NSEvent* event);
31
27 } // namespace ui 32 } // namespace ui
28 33
29 #endif // UI_EVENTS_COCOA_COCOA_EVENT_UTILS_H_ 34 #endif // UI_EVENTS_COCOA_COCOA_EVENT_UTILS_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/web_input_event_builders_mac.mm ('k') | ui/events/cocoa/cocoa_event_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698