infobar->launcher: can manage ctrl-c/ctrl-d (for cancel) & Add doxygen comment

This commit is contained in:
Martin Duquesnoy 2009-01-18 21:42:39 +01:00
parent 936a369278
commit b49f81d83b
2 changed files with 13 additions and 3 deletions

View File

@ -200,6 +200,11 @@ uicb_infobar_togglepos(uicb_t cmd)
return;
}
/** Create a launcher in the infobar for execute
* a system command (with spawn)
* \param cmd uicb_t type unused
* \todo manage Home, End and arrows key
*/
void
uicb_launcher(uicb_t cmd)
{
@ -235,13 +240,18 @@ uicb_launcher(uicb_t cmd)
GrabModeAsync, CurrentTime) != GrabSuccess)
sleep(500);
while(lrun)
{
if(ev.type == KeyPress)
{
XLookupString(&ev.xkey, tmp, sizeof(tmp), &ks, 0);
/* Check Ctrl-c / Ctrl-d */
if(ev.xkey.state & ControlMask)
if(ks == XK_c
|| ks == XK_d)
ks = XK_Escape;
switch(ks)
{
case XK_Return:
@ -262,7 +272,7 @@ uicb_launcher(uicb_t cmd)
}
barwin_refresh_color(launch);
barwin_draw_text(launch, 2, font->height, LPROMPT);
barwin_draw_text(launch, textw(LPROMPT) + 2, font->height, buf);
barwin_draw_text(launch, textw(LPROMPT) + textw(" "), font->height, buf);
barwin_refresh(launch);
}
else

View File

@ -85,7 +85,7 @@
#define LEN(x) (sizeof(x) / sizeof((x)[0]))
#define deb(p) fprintf(stderr, "debug: %d\n", (p))
#define PAD (14)
#define LPROMPT "Exec: "
#define LPROMPT "Exec: "
/* barwin.c */
BarWindow *barwin_create(Window parent,