Commit d861e99 support screen resize as hotkey in form (#1432926)

3 files Authored and Committed by mlichvar 5 months ago
support screen resize as hotkey in form (#1432926)

    
 1 @@ -1031,6 +1031,18 @@
 2   »       if (needResize) {
 3   »       »       needResize = 0;
 4   »       »       newtResizeScreen(1);
 5 + 
 6 + »       »       /* The application may want to handle the resize */
 7 + »       »       for (i = 0; i < form->numHotKeys; i++) {
 8 + »       »           if (form->hotKeys[i] == NEWT_KEY_RESIZE) {
 9 + »       »       »       es->reason = NEWT_EXIT_HOTKEY;
10 + »       »       »       es->u.key = NEWT_KEY_RESIZE;
11 + »       »       »       done = 1;
12 + »       »       »       break;
13 + »       »           }
14 + »       »       }
15 + »       »       if (done)
16 + »       »           break;
17   »       }
18   
19   »       i = select(max + 1, &readSet, &writeSet, &exceptSet, 
1 @@ -1499,6 +1499,7 @@
2       setitemstring_decref(d, "KEY_F11", PyInt_FromLong(NEWT_KEY_F11));
3       setitemstring_decref(d, "KEY_F12", PyInt_FromLong(NEWT_KEY_F12));
4       setitemstring_decref(d, "KEY_ESC", PyInt_FromLong(NEWT_KEY_ESCAPE));
5 +     setitemstring_decref(d, "KEY_RESIZE", PyInt_FromLong(NEWT_KEY_RESIZE));
6   
7       setitemstring_decref(d, "FLAG_DISABLED", PyInt_FromLong(NEWT_FLAG_DISABLED));
8       setitemstring_decref(d, "FLAGS_SET", PyInt_FromLong(NEWT_FLAGS_SET));
1 @@ -303,7 +303,7 @@
2               "F12" : _snack.KEY_F12, "ESC" : _snack.KEY_ESC,
3               "ENTER": _snack.KEY_ENTER, "SUSPEND" : _snack.KEY_SUSPEND,
4               "BACKSPACE": _snack.KEY_BACKSPACE, "DELETE": _snack.KEY_DELETE,
5 -             "INSERT": _snack.KEY_INSERT,
6 +             "INSERT": _snack.KEY_INSERT, "RESIZE": _snack.KEY_RESIZE,
7                " " : ord(" ") }
8   
9   for n in list(hotkeys.keys()):