This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Atomic file save/load utilities with backup, compression, and msgspec.Struct integration. | |
Features: | |
- Atomic save: ensures either the old or new file is present after a crash. | |
- Automatic backup rotation: configurable number of backups (.bakN). | |
- Zstandard compression for efficient storage and automatic checksum integrity verification. | |
- msgspec integration: serialize/deserialize Python dataclasses with msgpack. | |
- Automatic recovery from most recent valid backup on load. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The ideas: | |
// - Initialize varying key to SDL_SCANCODE_UNKNOWN | |
// - On KeyPress, retrieve the actual ASCII code corresponding to the letter, and map related input | |
static void ImGui_ImplSDL2_SetScancodeFromLetter(ImGuiIO& io, int scanCode, int ascii) | |
{ | |
switch (ascii) | |
{ | |
case 'a': case 'A': | |
io.KeyMap[ImGuiKey_A] = scanCode; |