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

Side by Side Diff: sky/engine/core/events/KeyboardEvent.cpp

Issue 880473003: sky-scrollable should use a reasonable fling curve (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Now with heights Created 5 years, 11 months 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/events/KeyboardEvent.h" 6 #include "sky/engine/core/events/KeyboardEvent.h"
7 7
8 namespace blink { 8 namespace blink {
9 9
10 static AtomicString stringForType(WebInputEvent::Type type) 10 static AtomicString stringForType(WebInputEvent::Type type)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 : Event(stringForType(event.type), true, true) 53 : Event(stringForType(event.type), true, true)
54 , m_key(event.key) 54 , m_key(event.key)
55 , m_location(locationFromModifiers(event.modifiers)) 55 , m_location(locationFromModifiers(event.modifiers))
56 , m_charCode(event.charCode) 56 , m_charCode(event.charCode)
57 , m_ctrlKey(event.modifiers & WebInputEvent::ControlKey) 57 , m_ctrlKey(event.modifiers & WebInputEvent::ControlKey)
58 , m_shiftKey(event.modifiers & WebInputEvent::ShiftKey) 58 , m_shiftKey(event.modifiers & WebInputEvent::ShiftKey)
59 , m_altKey(event.modifiers & WebInputEvent::AltKey) 59 , m_altKey(event.modifiers & WebInputEvent::AltKey)
60 , m_metaKey(event.modifiers & WebInputEvent::MetaKey) 60 , m_metaKey(event.modifiers & WebInputEvent::MetaKey)
61 , m_repeat(event.modifiers & WebInputEvent::IsAutoRepeat) 61 , m_repeat(event.modifiers & WebInputEvent::IsAutoRepeat)
62 { 62 {
63 m_timeStamp = event.timeStampMS;
64
63 if (event.type == WebInputEvent::KeyDown || event.type == WebInputEvent::Key Up) { 65 if (event.type == WebInputEvent::KeyDown || event.type == WebInputEvent::Key Up) {
64 m_charCode = 0; 66 m_charCode = 0;
65 } else if (event.type == WebInputEvent::Char) { 67 } else if (event.type == WebInputEvent::Char) {
66 m_key = 0; 68 m_key = 0;
67 m_location = String(); 69 m_location = String();
68 } 70 }
69 } 71 }
70 72
71 KeyboardEvent::KeyboardEvent(const AtomicString& type, const KeyboardEventInit& initializer) 73 KeyboardEvent::KeyboardEvent(const AtomicString& type, const KeyboardEventInit& initializer)
72 : Event(type, initializer) 74 : Event(type, initializer)
73 , m_key(initializer.key) 75 , m_key(initializer.key)
74 , m_location(initializer.location) 76 , m_location(initializer.location)
75 , m_charCode(initializer.charCode) 77 , m_charCode(initializer.charCode)
76 , m_ctrlKey(initializer.ctrlKey) 78 , m_ctrlKey(initializer.ctrlKey)
77 , m_shiftKey(initializer.shiftKey) 79 , m_shiftKey(initializer.shiftKey)
78 , m_altKey(initializer.altKey) 80 , m_altKey(initializer.altKey)
79 , m_metaKey(initializer.metaKey) 81 , m_metaKey(initializer.metaKey)
80 , m_repeat(initializer.repeat) 82 , m_repeat(initializer.repeat)
81 { 83 {
82 } 84 }
83 85
84 } // namespace blink 86 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698