KeyboardCode

Codes of keyboard keys.

Header#include "nativeui/events/keyboard_codes.h"
Namespacenamespace nu
Typeenum

KeyboardCode is an enum with following values, the actual integer values are different on different platforms:

Global functions

const char* KeyboardCodeToStr(KeyboardCode code)

Convert a key code to string, using the values of KeyboardEvent.key, a list of available keys can be found at: Key Values - MDN.

There is an exception that the Space Bar is represented as "Space" in Yue instead of " ".

Parameters

Return

const char*

KeyboardCode KeyboardCodeFromStr(const std::string& str, bool* shifted)

Convert a string to a KeyboardCode.

Parameters

Return

KeyboardCode