diff options
| author | KonAki <konaki@anokonaki.org> | 2026-10-09 17:38:43 +0800 |
|---|---|---|
| committer | KonAki <konaki@anokonaki.org> | 2026-10-09 17:38:43 +0800 |
| commit | 3e4acddeb4df4d21ad89b8926aa2eafc634daa25 (patch) | |
| tree | cf86972b240f2ea8752bd726cbed328dcd7de265 /kon/kondebug.c | |
| parent | af7dafe1d79e39ba2d51a6e3f10990d9e8df3735 (diff) | |
Add mouse wheel events and wheel zoom in modelview
Diffstat (limited to 'kon/kondebug.c')
| -rw-r--r-- | kon/kondebug.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kon/kondebug.c b/kon/kondebug.c index a905adc..a68ebcf 100644 --- a/kon/kondebug.c +++ b/kon/kondebug.c @@ -541,6 +541,12 @@ int kon_debugFeedEvent(kon_debug_t *d, const kon_event_t *e) if (e->codepoint >= 32 && e->codepoint <= 126) kon_debugInsert_(d, (char)e->codepoint); return 1; } + if (e->type == KON_EVENT_MOUSE_WHEEL) { + d->scroll += e->wheel * 3; + if (d->scroll < 0) d->scroll = 0; + if (d->scroll > d->logCount - 1) d->scroll = d->logCount > 0 ? d->logCount - 1 : 0; + return 1; + } if (e->type == KON_EVENT_KEY_UP) return 1; if (e->type != KON_EVENT_KEY_DOWN) return 0; |
