Flutter Engine
The Flutter Engine
key_data_packet.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/lib/ui/window/key_data_packet.h"
6
7#include <cstring>
8#include <iostream>
9
10#include "flutter/fml/logging.h"
11
12namespace flutter {
13
15 size_t char_size = character == nullptr ? 0 : strlen(character);
16 uint64_t char_size_64 = char_size;
17 data_.resize(sizeof(char_size_64) + sizeof(KeyData) + char_size);
18 memcpy(CharacterSizeStart(), &char_size_64, sizeof(char_size_64));
19 memcpy(KeyDataStart(), &event, sizeof(KeyData));
20 if (character != nullptr) {
21 memcpy(CharacterStart(), character, char_size);
22 }
23}
24
26
27} // namespace flutter
KeyDataPacket(const KeyData &event, const char *character)
FlKeyEvent * event