feat: add keyboard layout support

This commit is contained in:
2026-08-13 17:57:44 +02:00
parent 86e3ebfe33
commit 821543238d
36 changed files with 1132 additions and 125 deletions
+3 -2
View File
@@ -1063,7 +1063,8 @@ static bool handle_key(montauk::abi::KeyEvent& key, int win_id) {
}
if (key.scancode == 0x4B) { if (g_pathbar_cursor > 0) g_pathbar_cursor--; return true; }
if (key.scancode == 0x4D) { if (g_pathbar_cursor < g_pathbar_len) g_pathbar_cursor++; return true; }
if (key.ascii >= 32 && key.ascii < 127 && g_pathbar_len < 254) {
if ((unsigned char)key.ascii >= 32
&& (unsigned char)key.ascii != 127 && g_pathbar_len < 254) {
for (int i = g_pathbar_len; i > g_pathbar_cursor; i--)
g_pathbar_text[i] = g_pathbar_text[i - 1];
g_pathbar_text[g_pathbar_cursor] = key.ascii;
@@ -1214,7 +1215,7 @@ static bool handle_key(montauk::abi::KeyEvent& key, int win_id) {
}
// Printable
if (key.ascii >= 32 && key.ascii < 127) {
if ((unsigned char)key.ascii >= 32 && (unsigned char)key.ascii != 127) {
if (g_has_selection) delete_selection();
insert_char(key.ascii);
return true;