mirror of
https://github.com/0intro/wmii
synced 2024-11-22 05:42:05 +03:00
[wikeyname] Prompt the user for a key if isatty(1).
This commit is contained in:
parent
d9486fa419
commit
f45311261e
@ -5,6 +5,7 @@
|
|||||||
#include <stuff/x.h>
|
#include <stuff/x.h>
|
||||||
#include <fmt.h>
|
#include <fmt.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
static const char version[] = "wikeyname-"VERSION", "COPYRIGHT"\n";
|
static const char version[] = "wikeyname-"VERSION", "COPYRIGHT"\n";
|
||||||
|
|
||||||
@ -38,8 +39,10 @@ main(int argc, char *argv[]) {
|
|||||||
if(!grabkeyboard(&scr.root))
|
if(!grabkeyboard(&scr.root))
|
||||||
fatal("can't grab keyboard\n");
|
fatal("can't grab keyboard\n");
|
||||||
|
|
||||||
|
if(isatty(1))
|
||||||
|
lprint(2, "Please press a key...\n");
|
||||||
event_loop();
|
event_loop();
|
||||||
print("%s\n", keyname);
|
lprint(1, "%s\n", keyname);
|
||||||
|
|
||||||
XCloseDisplay(display);
|
XCloseDisplay(display);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user