[hackers] [swk] fix keysym input (with unicode support) || pancake

From: <hg_AT_suckless.org>
Date: Tue, 20 Apr 2010 08:32:48 +0000 (UTC)

changeset: 7:e5260f6c7f92
tag: tip
user: pancake <pancake_AT_nopcode.org>
date: Tue Apr 20 10:26:17 2010 +0200
files: gi_sdl.c swk.c
description:
fix keysym input (with unicode support)
remove outdated stuff

diff -r 87a34b9b4a6f -r e5260f6c7f92 gi_sdl.c
--- a/gi_sdl.c Tue Apr 20 10:19:39 2010 +0200
+++ b/gi_sdl.c Tue Apr 20 10:26:17 2010 +0200
@@ -18,10 +18,8 @@
 
 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 @@
         SDL_Quit();
 }
 
-static char sdlkeys[256] = { 0 }; // TODO
-
 SwkEvent *
 swk_gi_event(int dowait) {
         int evret;
@@ -73,7 +69,7 @@
         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 -r 87a34b9b4a6f -r e5260f6c7f92 swk.c
--- a/swk.c Tue Apr 20 10:19:39 2010 +0200
+++ b/swk.c Tue Apr 20 10:26:17 2010 +0200
@@ -102,6 +102,11 @@
 
 void
 swk_button(SwkEvent *e) {
+ switch(e->type) {
+ case EExpose:
+ // TODO: use box position
+ swk_gi_rect(0, 0, 10, 10);
+ }
 }
 
 void
Received on Tue Apr 20 2010 - 08:32:48 UTC

This archive was generated by hypermail 2.2.0 : Tue Apr 20 2010 - 08:36:04 UTC