From e8e8d6e2aaec02b9687ca8f2029bb6473acb0ec7 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 16 Oct 2002 09:40:36 +0000 Subject: [PATCH] Bug `shift-backspace': whichever of ^H and ^? is configured for 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 | 6 ++++++ window.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/unix/pterm.c b/unix/pterm.c index 1fcaa327..773c3eda 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -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 || diff --git a/window.c b/window.c index a4a376bb..aa6b6809 100644 --- 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++ = '['; -- 2.11.0