Bug `shift-backspace': whichever of ^H and ^? is configured for
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 16 Oct 2002 09:40:36 +0000 (09:40 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 16 Oct 2002 09:40:36 +0000 (09:40 +0000)
Backspace, Shift-Backspace should do the _other_ one. Thanks to
Justin Bradford.

git-svn-id: svn://svn.tartarus.org/sgt/putty@2079 cda61777-01e9-0310-a592-d414129be87e

unix/pterm.c
window.c

index 1fcaa32..773c3ed 100644 (file)
@@ -472,6 +472,12 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
            output[1] = cfg.bksp_is_delete ? '\x7F' : '\x08';
            end = 2;
        }
+       /* For Shift Backspace, do opposite of what is configured. */
+       if (event->keyval == GDK_BackSpace &&
+           (event->state & GDK_SHIFT_MASK)) {
+           output[1] = cfg.bksp_is_delete ? '\x08' : '\x7F';
+           end = 2;
+       }
 
        /* Shift-Tab is ESC [ Z */
        if (event->keyval == GDK_ISO_Left_Tab ||
index a4a376b..aa6b680 100644 (file)
--- a/window.c
+++ b/window.c
@@ -3404,6 +3404,12 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
            *p++ = 0;
            return -2;
        }
+       if (wParam == VK_BACK && shift_state == 1) {    /* Shift Backspace */
+           /* We do the opposite of what is configured */
+           *p++ = (cfg.bksp_is_delete ? 0x08 : 0x7F);
+           *p++ = 0;
+           return -2;
+       }
        if (wParam == VK_TAB && shift_state == 1) {     /* Shift tab */
            *p++ = 0x1B;
            *p++ = '[';