Adding close button.

master
Christoph Lohmann 14 years ago
parent fb55e57fc1
commit 6e23a19d2f
  1. 1
      layout.arrows.h
  2. 1
      layout.de.h
  3. 1
      layout.en.h
  4. 7
      svkbd.c

@ -5,6 +5,7 @@ static Key keys[] = {
{ "", XK_Up, 1 }, { "", XK_Up, 1 },
{ "", XK_Right, 1}, { "", XK_Right, 1},
{ "Alt", XK_Alt_L, 2 }, { "Alt", XK_Alt_L, 2 },
{ "[X]", XK_Cancel, 1 },
}; };
Buttonmod buttonmods[] = { Buttonmod buttonmods[] = {

@ -64,6 +64,7 @@ static Key keys[] = {
{ "Alt Gr", XK_ISO_Level3_Shift, 2 }, { "Alt Gr", XK_ISO_Level3_Shift, 2 },
{ "Menu", XK_Menu, 2 }, { "Menu", XK_Menu, 2 },
{ "Ctrl", XK_Control_R, 2 }, { "Ctrl", XK_Control_R, 2 },
{ "[X]", XK_Cancel, 1},
}; };
Buttonmod buttonmods[] = { Buttonmod buttonmods[] = {

@ -60,6 +60,7 @@ static Key keys[] = {
{ "", XK_space, 5 }, { "", XK_space, 5 },
{ "Alt", XK_Alt_R, 2 }, { "Alt", XK_Alt_R, 2 },
{ "Ctrl", XK_Control_R, 2 }, { "Ctrl", XK_Control_R, 2 },
{ "[X]", XK_Cancel, 1},
}; };
Buttonmod buttonmods[] = { Buttonmod buttonmods[] = {

@ -297,6 +297,13 @@ press(Key *k, KeySym mod) {
int i; int i;
k->pressed = !k->pressed; k->pressed = !k->pressed;
switch(k->keysym) {
case XK_Cancel:
exit(0);
default:
break;
}
if(!IsModifierKey(k->keysym)) { if(!IsModifierKey(k->keysym)) {
for(i = 0; i < LENGTH(keys); i++) for(i = 0; i < LENGTH(keys); i++)
if(keys[i].pressed && IsModifierKey(keys[i].keysym)) if(keys[i].pressed && IsModifierKey(keys[i].keysym))

Loading…
Cancel
Save