swk

static widget kit
git clone git://git.suckless.org/swk
Log | Files | Refs | README | LICENSE

commit 9dd2455fa092b57b1b5033c8289686f607b434d4
parent fa5e9defd0b57e88fd8d2abbdf25448f8b86003a
Author: pancake <pancake@nopcode.org>
Date:   Tue, 20 Apr 2010 10:26:17 +0200

fix keysym input (with unicode support)
remove outdated stuff
Diffstat:
gi_sdl.c | 6+-----
swk.c | 5+++++
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gi_sdl.c b/gi_sdl.c @@ -18,10 +18,8 @@ swk_gi_init(SwkWindow *w) { int swk_gi_update(SwkWindow *w) { - /* nothing to do here */ SDL_SetVideoMode(screen->w, screen->h, 32, SDL_DOUBLEBUF|SDL_RESIZABLE); screen = SDL_GetVideoSurface(); - fprintf(stderr, "NEW(%d,%d)\n", screen->w, screen->h); return 1; } @@ -30,8 +28,6 @@ swk_gi_exit() { SDL_Quit(); } -static char sdlkeys[256] = { 0 }; // TODO - SwkEvent * swk_gi_event(int dowait) { int evret; @@ -73,7 +69,7 @@ swk_gi_event(int dowait) { case SDL_KEYDOWN: ret = &ev; ev.type = EKey; - ev.data.key.keycode = sdlkeys[event.key.keysym.sym]; + ev.data.key.keycode = event.key.keysym.unicode; ev.data.key.modmask = 0; if(event.key.keysym.mod & KMOD_LCTRL || event.key.keysym.mod & KMOD_RCTRL) diff --git a/swk.c b/swk.c @@ -102,6 +102,11 @@ swk_entry(SwkEvent *e) { void swk_button(SwkEvent *e) { + switch(e->type) { + case EExpose: + // TODO: use box position + swk_gi_rect(0, 0, 10, 10); + } } void