URI: 
       tExit when pressing 'q' - croptool - Image cropping tool
  HTML git clone git://lumidify.org/croptool.git (fast, but not encrypted)
  HTML git clone https://lumidify.org/git/croptool.git (encrypted, but very slow)
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 022ad164b6516bbb4c5109e45c68248c17ff7115
   DIR parent 71d1f49b960b895f769450c895a010469b2fd9a4
  HTML Author: lumidify <nobody@lumidify.org>
       Date:   Fri, 18 Aug 2023 08:55:37 +0200
       
       Exit when pressing 'q'
       
       Diffstat:
         M LICENSE                             |       2 +-
         M croptool.1                          |       4 +++-
         M croptool.c                          |      11 +++++++----
       
       3 files changed, 11 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/LICENSE b/LICENSE
       t@@ -1,4 +1,4 @@
       -Copyright (c) 2021-2022 lumidify <nobody@lumidify.org>
       +Copyright (c) 2021-2023 lumidify <nobody@lumidify.org>
        
        Permission to use, copy, modify, and/or distribute this software for any
        purpose with or without fee is hereby granted, provided that the above
   DIR diff --git a/croptool.1 b/croptool.1
       t@@ -1,4 +1,4 @@
       -.Dd January 13, 2022
       +.Dd August 18, 2023
        .Dt CROPTOOL 1
        .Os
        .Sh NAME
       t@@ -120,6 +120,8 @@ Delete the cropping rectangle of the current image.
        Redraw the window.
        This is useful when automatic redrawing is disabled with
        .Fl m .
       +.It q
       +Exit the program.
        .El
        .Sh MOUSE ACTIONS
        .Bl -tag -width Ds
   DIR diff --git a/croptool.c b/croptool.c
       t@@ -1,5 +1,5 @@
        /*
       - * Copyright (c) 2021-2022 lumidify <nobody@lumidify.org>
       + * Copyright (c) 2021-2023 lumidify <nobody@lumidify.org>
         *
         * Permission to use, copy, modify, and/or distribute this software for any
         * purpose with or without fee is hereby granted, provided that the above
       t@@ -160,7 +160,7 @@ static void drag_motion(XEvent event);
        static void resize_window(int w, int h);
        static void button_release(void);
        static void button_press(XEvent event);
       -static void key_press(XEvent event);
       +static int key_press(XEvent event);
        static void queue_update(int x, int y, int w, int h);
        static int parse_int(const char *str, int min, int max, int *value);
        
       t@@ -273,7 +273,7 @@ mainloop(void) {
                                        drag_motion(event);
                                        break;
                                case KeyPress:
       -                                key_press(event);
       +                                running = key_press(event);
                                        break;
                                case ClientMessage:
                                        if ((Atom)event.xclient.data.l[0] == state.wm_delete_msg)
       t@@ -1103,7 +1103,7 @@ switch_color(void) {
                queue_update(0, 0, state.window_w, state.window_h);
        }
        
       -static void
       +static int
        key_press(XEvent event) {
                XWindowAttributes attrs;
                char buf[32];
       t@@ -1135,7 +1135,10 @@ key_press(XEvent event) {
                           size didn't change */
                        queue_update(0, 0, state.window_w, state.window_h);
                        break;
       +        case XK_q:
       +                return 0;
                default:
                        break;
                }
       +        return 1;
        }