svkbd

simple virtual keyboard
git clone git://git.suckless.org/svkbd
Log | Files | Refs | LICENSE

commit 6e23a19d2f80b46924e31ea5d9b46d95ce709e66
parent fb55e57fc1cf493e4bda81cf4baaada4e99f10e3
Author: Christoph Lohmann <20h@r-36.net>
Date:   Mon,  4 Apr 2011 22:43:12 +0200

Adding close button.
Diffstat:
layout.arrows.h | 1+
layout.de.h | 1+
layout.en.h | 1+
svkbd.c | 7+++++++
4 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/layout.arrows.h b/layout.arrows.h @@ -5,6 +5,7 @@ static Key keys[] = { { "↑", XK_Up, 1 }, { "→", XK_Right, 1}, { "Alt", XK_Alt_L, 2 }, + { "[X]", XK_Cancel, 1 }, }; Buttonmod buttonmods[] = { diff --git a/layout.de.h b/layout.de.h @@ -64,6 +64,7 @@ static Key keys[] = { { "Alt Gr", XK_ISO_Level3_Shift, 2 }, { "Menu", XK_Menu, 2 }, { "Ctrl", XK_Control_R, 2 }, + { "[X]", XK_Cancel, 1}, }; Buttonmod buttonmods[] = { diff --git a/layout.en.h b/layout.en.h @@ -60,6 +60,7 @@ static Key keys[] = { { "", XK_space, 5 }, { "Alt", XK_Alt_R, 2 }, { "Ctrl", XK_Control_R, 2 }, + { "[X]", XK_Cancel, 1}, }; Buttonmod buttonmods[] = { diff --git a/svkbd.c b/svkbd.c @@ -297,6 +297,13 @@ press(Key *k, KeySym mod) { int i; k->pressed = !k->pressed; + switch(k->keysym) { + case XK_Cancel: + exit(0); + default: + break; + } + if(!IsModifierKey(k->keysym)) { for(i = 0; i < LENGTH(keys); i++) if(keys[i].pressed && IsModifierKey(keys[i].keysym))