Flutter Engine
The Flutter Engine
lib
ui
window
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
12
namespace
flutter
{
13
14
KeyDataPacket::KeyDataPacket
(
const
KeyData
&
event
,
const
char
*
character
) {
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
25
KeyDataPacket::~KeyDataPacket
() =
default
;
26
27
}
// namespace flutter
flutter::KeyDataPacket::KeyDataPacket
KeyDataPacket(const KeyData &event, const char *character)
Definition:
key_data_packet.cc:14
flutter::KeyDataPacket::~KeyDataPacket
~KeyDataPacket()
event
FlKeyEvent * event
Definition:
fl_key_channel_responder.cc:118
character
char32_t character
Definition:
keyboard_key_handler_unittests.cc:117
flutter
Definition:
asset_manager.cc:10
flutter::KeyData
Definition:
key_data.h:61
Generated on Sun Jun 23 2024 21:55:06 for Flutter Engine by
1.9.4