]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/MKkey_defs.sh
ncurses 6.2 - patch 20200829
[ncurses.git] / include / MKkey_defs.sh
index 865a7b9c8b875649cd60141bfe34f6e6c1a4ff14..86d6891c369316d14781aef8cde087f95a8379ee 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $Id: MKkey_defs.sh,v 1.19 2020/02/02 23:34:34 tom Exp $
+# $Id: MKkey_defs.sh,v 1.21 2020/08/17 10:45:33 tom Exp $
 ##############################################################################
 # Copyright 2019,2020 Thomas E. Dickey                                       #
 # Copyright 2001-2013,2017 Free Software Foundation, Inc.                    #
@@ -63,8 +63,7 @@ fi
 
 # add keys that we generate automatically:
 cat >>$data <<EOF
-key_resize     kr1     str     R1      KEY_RESIZE      +       -----   Terminal resize event
-key_event      kv1     str     V1      KEY_EVENT       +       -----   We were interrupted by an event
+key_resize     kr1     str     R1      KEY_RESIZE      +       NCURSES_EXT_FUNCS       Terminal resize event
 EOF
 
 THIS=./`basename $0`
@@ -142,6 +141,12 @@ $5 != "-" && $6 != "-" {
                        maxkey = thiskey;
                if (pass == 2 || pass == 3) {
                        showkey=sprintf(octal_fmt, thiskey);
+                       ifdef = 0;
+                       if (index($7,"NCURSES_") == 1) {
+                               ifdef = 1;
+                               printf "\n";
+                               printf "#ifdef %s\n", $7;
+                       }
                        if ($5 == "KEY_F(0)" ) {
                                printf "#define "
                                print_cols("KEY_F0", 16);
@@ -160,6 +165,9 @@ $5 != "-" && $6 != "-" {
                                        printf " %s", $i
                                print " */"
                        }
+                       if (ifdef != 0) {
+                               printf "#endif\n";
+                       }
                }
        }
 END    {