changed caps lock to escape key.

This commit is contained in:
2026-02-05 11:35:16 -07:00
parent 4f9fd2b7c2
commit 29b48ff2ca
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ static const KeyMapping key_map[] = {
{"p", "P", KEY_P}, {"[", "{", KEY_LEFTBRACE}, {"]", "}", KEY_RIGHTBRACE}, {"\\", "|", KEY_BACKSLASH},
/* Row 2 */
{"Caps Lock", "Caps Lock", KEY_CAPSLOCK}, {"a", "A", KEY_A}, {"s", "S", KEY_S}, {"d", "D", KEY_D},
{"Escape", "Escape", KEY_ESC}, {"a", "A", KEY_A}, {"s", "S", KEY_S}, {"d", "D", KEY_D},
{"f", "F", KEY_F}, {"g", "G", KEY_G}, {"h", "H", KEY_H}, {"j", "J", KEY_J}, {"k", "K", KEY_K},
{"l", "L", KEY_L}, {";", ":", KEY_SEMICOLON}, {"'", "\"", KEY_APOSTROPHE}, {"Enter", "Enter", KEY_ENTER},
+1 -3
View File
@@ -145,9 +145,8 @@ static void activate(GtkApplication *app, gpointer user_data) {
GTK_GRID(gtk_builder_get_object(builder, "kbd_row_4"))
};
// Map keys from keymap.h to the UI grids
int current_key = 0;
int row_counts[] = {14, 14, 13, 12, 6}; // Matches keymap.h layout
int row_counts[] = {14, 14, 13, 12, 6};
for (int r = 0; r < 5; r++) {
int current_col = 0;
@@ -157,7 +156,6 @@ static void activate(GtkApplication *app, gpointer user_data) {
const char *label = key_map[current_key].label;
int width = 1;
// Dynamic width logic
if (g_strcmp0(label, "Space") == 0) width = 7;
else if (g_strcmp0(label, "Backspace") == 0) width = 2;
else if (g_strcmp0(label, "Enter") == 0) width = 3;