feat: switch text to UTF-8; add Unicode key events, dead keys & Czech layout; fix numpad navigation; add NumLock support

This commit is contained in:
daniel committed 2026-10-03 10:11:49 +02:00
1 parent 32660ddd1a
commit 2aa6360b3d
101 files changed
+3733 -1639

No files matched your search

+73 -18
View File
@@ -6,29 +6,84 @@
#pragma once
// Userspace mirror of kernel/src/Common/StatusCodes.hpp. Also usable from C
// (the libc includes it), where the enumerators are unqualified.
// Userspace status codes.
// Analogous to kernel/src/Common/StatusCodes.hpp, but positive numbers are used.
#ifdef __cplusplus
namespace montauk {
#endif
enum StatusCode {
typedef enum {
Success = 0,
GenericFailure = -1,
PermissionDenied = -2,
CapabilityDenied = -3,
SystemIntegrityError = -4,
BadPointer = -5,
InvalidArgument = -6,
UnsupportedOp = -7,
NoDevice = -8,
IoFailure = -9,
BadInvocation = -10,
NoSuchPath = -11,
Busy = -12,
BufferTooSmall = -13,
OutOfMemory = -14
};
GenericFailure = 1,
PermissionDenied = 2,
CapabilityDenied = 3,
SystemIntegrityError = 4,
BadPointer = 5,
InvalidArgument = 6,
UnsupportedOp = 7,
NoDevice = 8,
IoFailure = 9,
BadInvocation = 10,
NoSuchPath = 11,
Busy = 12,
BufferTooSmall = 13,
OutOfMemory = 14
} StatusCode;
inline const char* GetStatusText(StatusCode statusCode) {
const char* statusText[] = {
"Success", // 0
"Generic failure", // 1
"Permission denied", // 2
"Capability denied", // 3
"System integrity error", // 4
"Bad pointer", // 5
"Invalid argument", // 6
"Unsupported operation", // 7
"No device", // 8
"I/O failure", // 9
"Bad invocation", // 10
"No such path", // 11
"Busy", // 12
"Buffer too small", // 13
"Out of memory", // 14
};
if (statusCode > 0 && statusCode <= 14) {
return statusText[statusCode];
} else {
return "Unknown error";
}
}
// Shared with C (libc.c), so no nullptr.
inline const char* GetStatusExplanationText(StatusCode statusCode) {
const char* explanationText[] = {
0, // 0
0, // 1
0, // 2
0, // 3
"The path is protected by the system and cannot be modified.", // 4
0, // 5
0, // 6
0, // 7
0, // 8
0, // 9
0, // 10
0, // 11
0, // 12
"The buffer supplied by the caller is too small.", // 13
0, // 14
};
if (statusCode > 0 && statusCode <= 14) {
if (explanationText[statusCode] != 0) {
return explanationText[statusCode];
}
}
return GetStatusText(statusCode);
}
#ifdef __cplusplus
}