changed caps lock to escape key.
This commit is contained in:
@@ -21,7 +21,7 @@ static const KeyMapping key_map[] = {
|
|||||||
{"p", "P", KEY_P}, {"[", "{", KEY_LEFTBRACE}, {"]", "}", KEY_RIGHTBRACE}, {"\\", "|", KEY_BACKSLASH},
|
{"p", "P", KEY_P}, {"[", "{", KEY_LEFTBRACE}, {"]", "}", KEY_RIGHTBRACE}, {"\\", "|", KEY_BACKSLASH},
|
||||||
|
|
||||||
/* Row 2 */
|
/* 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},
|
{"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},
|
{"l", "L", KEY_L}, {";", ":", KEY_SEMICOLON}, {"'", "\"", KEY_APOSTROPHE}, {"Enter", "Enter", KEY_ENTER},
|
||||||
|
|
||||||
|
|||||||
@@ -145,9 +145,8 @@ static void activate(GtkApplication *app, gpointer user_data) {
|
|||||||
GTK_GRID(gtk_builder_get_object(builder, "kbd_row_4"))
|
GTK_GRID(gtk_builder_get_object(builder, "kbd_row_4"))
|
||||||
};
|
};
|
||||||
|
|
||||||
// Map keys from keymap.h to the UI grids
|
|
||||||
int current_key = 0;
|
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++) {
|
for (int r = 0; r < 5; r++) {
|
||||||
int current_col = 0;
|
int current_col = 0;
|
||||||
@@ -157,7 +156,6 @@ static void activate(GtkApplication *app, gpointer user_data) {
|
|||||||
const char *label = key_map[current_key].label;
|
const char *label = key_map[current_key].label;
|
||||||
int width = 1;
|
int width = 1;
|
||||||
|
|
||||||
// Dynamic width logic
|
|
||||||
if (g_strcmp0(label, "Space") == 0) width = 7;
|
if (g_strcmp0(label, "Space") == 0) width = 7;
|
||||||
else if (g_strcmp0(label, "Backspace") == 0) width = 2;
|
else if (g_strcmp0(label, "Backspace") == 0) width = 2;
|
||||||
else if (g_strcmp0(label, "Enter") == 0) width = 3;
|
else if (g_strcmp0(label, "Enter") == 0) width = 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user