summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2023-02-07 19:17:27 -0600
committerthe lemons <citrons@mondecitronne.com>2023-02-07 19:17:27 -0600
commit720f98b8ab509ae410840838b25a0e0337e50c92 (patch)
treef79725b2ff6f89f530499e26f9dc40c0c9ac3035
parent52fdf6319f79b41dbc8531556c0334d538d2dae3 (diff)
stop the process with space
-rw-r--r--core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core.c b/core.c
index 7129bbc..de685b6 100644
--- a/core.c
+++ b/core.c
@@ -4,6 +4,7 @@
#include <stdbool.h>
#include <unistd.h>
#include <assert.h>
+#include <signal.h>
#include <SDL.h>
#include "procfs.h"
@@ -168,6 +169,11 @@ static void handle_events() {
prev_map();
refresh = true;
break;
+ case SDLK_SPACE:;
+ static bool stopped = false;
+ kill(pid, stopped ? SIGSTOP : SIGCONT);
+ stopped = !stopped;
+ break;
default:
break;
}