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
+8
View File
@@ -13,6 +13,7 @@
#include "gui/mtk/widgets.hpp"
#include "gui/terminal.hpp"
#include <Api/Syscall.hpp>
#include <montauk/keyboard.h>
namespace gui {
@@ -234,6 +235,12 @@ struct DesktopState {
uint64_t thermal_last_poll;
Rect temp_icon_rect;
// Keyboard layouts. The desktop translates hardware scan codes before
// dispatching events, so embedded and external apps see the same layout.
montauk::keyboard::State keyboard;
Rect keyboard_layout_rect;
uint64_t keyboard_last_poll;
int screen_w, screen_h;
uint32_t* background_cache;
int background_cache_pitch;
@@ -269,5 +276,6 @@ void desktop_draw_panel(DesktopState* ds);
void desktop_draw_window(DesktopState* ds, int idx);
void desktop_handle_mouse(DesktopState* ds);
void desktop_handle_keyboard(DesktopState* ds, const montauk::abi::KeyEvent& key);
bool desktop_refresh_keyboard_layouts(DesktopState* ds, bool force);
} // namespace gui