summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0884f03)
raw | patch | inline | side by side (parent: 0884f03)
author | Kalle Wallin <kaw@linux.se> | |
Mon, 12 Jul 2004 20:40:02 +0000 (20:40 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Mon, 12 Jul 2004 20:40:02 +0000 (20:40 +0000) |
src/command.c | patch | blob | history | |
src/main.c | patch | blob | history | |
src/ncmpc.h | patch | blob | history | |
src/screen_utils.c | patch | blob | history | |
src/wreadln.c | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 1d77d0d2d4b9d4a413e387c1e4049ed786cddc7e..6cf3bf1720d3d534e443be900a8c0a0461ef3eb9 100644 (file)
--- a/src/command.c
+++ b/src/command.c
#include <string.h>
#include <ctype.h>
#include <glib.h>
+#include <signal.h>
#include <ncurses.h>
#include "config.h"
if( key==KEY_RESIZE )
screen_resize();
+#ifdef ENABLE_RAW_MODE
+ if( key==KEY_SIGSTOP )
+ sigstop();
+#endif
+
if( key==ERR )
return CMD_NONE;
#ifdef HAVE_GETMOUSE
- if( key==KEY_MOUSE )
- return CMD_MOUSE_EVENT;
+ // if( key==KEY_MOUSE )
+ // return CMD_MOUSE_EVENT;
#endif
return get_key_command(key);
diff --git a/src/main.c b/src/main.c
index 9497e3b61f80c81d87ea4b0850a47528f79400fa..19dad29873463bf1deeec23a8921ad19d40bde4d 100644 (file)
--- a/src/main.c
+++ b/src/main.c
catch_sigcont( int sig )
{
D("catch_sigcont()\n");
- screen_resize();
+#ifdef ENABLE_RAW_MODE
+ reset_prog_mode(); /* restore tty modes */
+ refresh();
+#endif
+ screen_resize();
+}
+
+void
+sigstop(void)
+{
+ def_prog_mode(); /* save the tty modes */
+ endwin(); /* end curses mode temporarily */
+ kill(0, SIGSTOP); /* issue SIGSTOP */
}
#ifdef DEBUG
diff --git a/src/ncmpc.h b/src/ncmpc.h
index 4118456a13ceea3fd0a4d5a2c4a48831c24da300..dec530dc2987c3e95d5aca86504a0398b2a04a63 100644 (file)
--- a/src/ncmpc.h
+++ b/src/ncmpc.h
#define DEFAULT_STATUS_FORMAT "[%artist% - ]%title%|%shortfile%"
#define STATUS_FORMAT (options.status_format ? options.status_format : DEFAULT_STATUS_FORMAT)
+/* sigstop key (Ctrl-Z) */
+#define KEY_SIGSTOP 26
+
+/* send SIGSTOP */
+void sigstop(void);
+
#endif /* NCMPC_H */
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 7e2ba146c632077de285a626ef87cf3edbaa53ee..cd3fc1ed073960593aa30c0bf11799e35904944c 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
while( (key=wgetch(w)) == ERR )
;
+#ifdef ENABLE_RAW_MODE
+ if( key==KEY_SIGSTOP )
+ sigstop();
+#endif
+
#ifdef HAVE_GETMOUSE
/* ignore mouse events */
if( key==KEY_MOUSE )
diff --git a/src/wreadln.c b/src/wreadln.c
index 3ebba7f2a340ffc809ac3d62b89f3511d0eea554..d0204329e8707c7921e02d4904a8223900965606 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
wrln_gcmp_post_cb_t wrln_post_completion_callback = NULL;
extern void screen_bell(void);
+extern void sigstop(void);
char *
wreadln(WINDOW *w,
case ERR: /* ingnore errors */
break;
+#ifdef ENABLE_RAW_MODE
+ case 26:
+ sigstop();
+ break;
+#endif
case KEY_RESIZE:
/* a resize event -> call an external callback function */
if( wrln_resize_callback )