infobar->launcher: can manage ctrl-c/ctrl-d (for cancel) & Add doxygen comment
This commit is contained in:
parent
936a369278
commit
b49f81d83b
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user