Hermes
0.7.0
Linux game streaming host
Toggle main menu visibility
Loading...
Searching...
No Matches
virtualhid_keyboard.cpp
Go to the documentation of this file.
1
5
#include "
virtualhid_keyboard.h
"
6
7
#include <string>
8
9
namespace
platf::keyboard {
10
void
update(input_raw_t *raw, std::uint16_t key_code,
bool
release, std::uint8_t flags) {
11
if
(!raw || !raw->keyboard) {
12
return
;
13
}
14
15
lvh::KeyboardEvent event;
16
event
.key_code = key_code;
17
event
.pressed = !
release
;
18
event
.uses_normalized_key_code = (flags & SS_KBE_FLAG_NON_NORMALIZED) == 0;
19
virtualhid::log_failure(
"keyboard event"
, raw->keyboard->submit(event));
20
}
21
22
void
unicode(input_raw_t *raw,
const
char
*utf8,
int
size) {
23
if
(!raw || !raw->keyboard || !utf8 || size <= 0) {
24
return
;
25
}
26
27
lvh::KeyboardTextEvent event;
28
event
.text.assign(utf8,
static_cast<
std::size_t
>
(size));
29
virtualhid::log_failure(
"keyboard text"
, raw->keyboard->type_text(event));
30
}
31
}
// namespace platf::keyboard
platf::gamepad::release
void release(input_raw_t *raw, int index)
Free a gamepad whose stream ended; a detached desktop keeps it.
Definition
virtualhid_gamepad.cpp:472
virtualhid_keyboard.h
Keyboard translation for the Linux libvirtualhid backend.
src
platform
linux
input
virtualhid_keyboard.cpp
Generated by
1.18.0