-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the Keymap_LoadRemapFile function
Splitting keymap host (PC) & guest (ST) value reads to separate functions both improves function readability and prepares it for further changes in later commits. Switching from strtok() to strtok_r() might also be needed by later commits. Other improvements: - Declare variables in scope closer to their use - File missing issue warrants a warning, not just debug msg - Add separate debug log for loading of the keymap file - Use ARRAY_SIZE() instead of define as loop limit - Warn if rest of mappings have to be skipped - Use Str_Trim() on results to skip white space before parsed items - Check/warn about PC & ST scancode errors separately (with line number) - If there are warnings, tell about them in an error dialog too This patch is originally written by Eero Tamminen, partly inspired by changes in a patch by Vincent Barrilliot, and has later been modified by Yves Le Berre and Thomas Huth.
- Loading branch information
Showing
1 changed file
with
106 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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