Sunshine master
Self-hosted game stream host for Moonlight.
inputtino_keyboard.cpp File Reference

Definitions for inputtino keyboard input handling. More...

#include <boost/locale.hpp>
#include <inputtino/input.hpp>
#include <libevdev/libevdev.h>
#include "inputtino_common.h"
#include "inputtino_keyboard.h"
#include "src/config.h"
#include "src/logging.h"
#include "src/platform/common.h"
#include "src/utility.h"
Include dependency graph for inputtino_keyboard.cpp:

Functions

std::string platf::keyboard::to_hex (const std::basic_string< char32_t > &str)
 
void platf::keyboard::unicode (input_raw_t *raw, char *utf8, int size)
 Submit UTF-8 text input to the keyboard backend.
 
void platf::keyboard::update (input_raw_t *raw, uint16_t modcode, bool release, uint8_t flags)
 Apply the supplied state update to the platform backend.
 

Detailed Description

Definitions for inputtino keyboard input handling.

Function Documentation

◆ to_hex()

std::string platf::keyboard::to_hex ( const std::basic_string< char32_t > & str)

Takes an UTF-32 encoded string and returns a hex string representation of the bytes (uppercase)

ex: ['👱'] = "1F471" // see UTF encoding at https://www.compart.com/en/unicode/U+1F471

adapted from: https://stackoverflow.com/a/7639754

Parameters
strUTF-8 text to encode as hexadecimal.
Returns
Value converted to hex.

◆ unicode()

void platf::keyboard::unicode ( input_raw_t * raw,
char * utf8,
int size )

Submit UTF-8 text input to the keyboard backend.

Parameters
rawPlatform-specific input backend state.
utf8UTF-8 text submitted by the client.
sizeNumber of bytes or elements requested.

◆ update()

void platf::keyboard::update ( input_raw_t * raw,
uint16_t modcode,
bool release,
uint8_t flags )

Apply the supplied state update to the platform backend.

Parameters
rawPlatform-specific input backend state.
modcodeModifier key code to update.
releaseWhether the key or button event is a release.
flagsBit flags that modify the requested operation.