From patchwork Wed May 13 23:54:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 48470 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CCC8821411 for ; Wed, 13 May 2015 23:54:34 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf13324344wgi.3 for ; Wed, 13 May 2015 16:54:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=8cQUVhlGK7iU6aKejzj2MhxUn7gbExKau2geGIgrRRQ=; b=MK9qx9f+yLP6TCLtt5iRYnA+0RFOe7tpsleXtRnplW/EPLz1hO+rA2AulcA0n0MpVH EKDM3TCUrSLKr2NzCZuE8Qnv5YyOh39tuyka2E0g7QztLaOGh2uerpcK+iPam+fasHlM OnBwIt+BjBU0V8o9jkSYcIIT02O/s5NmQTbyS+bqLDGOZXql1cQ1ItCXX/wb1iVsaUqK K0YxyxPd49vJCuwxZcYZOez96ACSDshINwgbyVMMQes6diy4P4BktmF+PrNgnUvQl1zd O0Qgjiroa8d3Cc8vdG5BhE9YU9kQ02coPw7d+gAIuoPaDvxkpyfi97IVMBDi0nnq6lsu qfzQ== X-Gm-Message-State: ALoCoQlnZoz9TSd0udFgzOn/KAqcfjjoS3ybnwmdItoP6jFrYVfPhNwhInqF5SiDmXkTsDaK+Chg X-Received: by 10.194.143.98 with SMTP id sd2mr988298wjb.6.1431561274190; Wed, 13 May 2015 16:54:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.162 with SMTP id g2ls337294lae.80.gmail; Wed, 13 May 2015 16:54:33 -0700 (PDT) X-Received: by 10.152.7.209 with SMTP id l17mr1003521laa.100.1431561273957; Wed, 13 May 2015 16:54:33 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id dw10si13321866lbd.67.2015.05.13.16.54.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2015 16:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagv1 with SMTP id v1so45025854lag.3 for ; Wed, 13 May 2015 16:54:33 -0700 (PDT) X-Received: by 10.112.163.168 with SMTP id yj8mr1015951lbb.36.1431561273759; Wed, 13 May 2015 16:54:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp844880lbb; Wed, 13 May 2015 16:54:32 -0700 (PDT) X-Received: by 10.107.46.218 with SMTP id u87mr1802622iou.68.1431561272245; Wed, 13 May 2015 16:54:32 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id eu19si16550589icb.100.2015.05.13.16.54.31 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 13 May 2015 16:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YsgTn-00049p-ID; Wed, 13 May 2015 23:54:23 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YsgTm-00049k-Ms for edk2-devel@lists.sourceforge.net; Wed, 13 May 2015 23:54:22 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.213.179 as permitted sender) client-ip=209.85.213.179; envelope-from=roy.franz@linaro.org; helo=mail-ig0-f179.google.com; Received: from mail-ig0-f179.google.com ([209.85.213.179]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YsgTl-000201-V1 for edk2-devel@lists.sourceforge.net; Wed, 13 May 2015 23:54:22 +0000 Received: by igbyr2 with SMTP id yr2so153606299igb.0 for ; Wed, 13 May 2015 16:54:16 -0700 (PDT) X-Received: by 10.107.134.66 with SMTP id i63mr534312iod.90.1431561256643; Wed, 13 May 2015 16:54:16 -0700 (PDT) Received: from rfranz-v430.caveonetworks.com (64.2.3.194.ptr.us.xo.net. [64.2.3.194]) by mx.google.com with ESMTPSA id b8sm15350575ioe.23.2015.05.13.16.54.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2015 16:54:15 -0700 (PDT) From: Roy Franz To: edk2-devel@lists.sourceforge.net, linaro-uefi@lists.linaro.org, feng.tian@intel.com Date: Wed, 13 May 2015 16:54:00 -0700 Message-Id: <1431561241-1411-4-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431561241-1411-1-git-send-email-roy.franz@linaro.org> References: <1431561241-1411-1-git-send-email-roy.franz@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1YsgTl-000201-V1 Subject: [edk2] [RFC 3/4] accept [3~ as delete for LinuxTerm terminals X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Accept the VT200 escape code [3~ as backspace for LinuxTerm terminals. Signed-off-by: Roy Franz Contributed-under: TianoCore Contribution Agreement 1.0 --- .../Universal/Console/TerminalDxe/Terminal.h | 1 + .../Universal/Console/TerminalDxe/TerminalConIn.c | 33 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h index e0335db..727cab8 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h @@ -117,6 +117,7 @@ typedef struct { #define INPUT_STATE_LEFTOPENBRACKET 0x04 #define INPUT_STATE_O 0x08 #define INPUT_STATE_2 0x10 +#define INPUT_STATE_LEFTOPENBRACKET_2 0x20 #define RESET_STATE_DEFAULT 0x00 #define RESET_STATE_ESC_R 0x01 diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 70ec370..b23b012 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -1397,6 +1397,12 @@ UnicodeToEfiKey ( TerminalDevice->TerminalType == VTUTF8TYPE || TerminalDevice->TerminalType == LINUXTERMTYPE) { switch (UnicodeChar) { + case '3': + if (TerminalDevice->TerminalType == LINUXTERMTYPE) { + TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_2; + continue; + } + break; case 'A': Key.ScanCode = SCAN_UP; break; @@ -1527,6 +1533,33 @@ UnicodeToEfiKey ( break; + case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTOPENBRACKET_2: + + Key.ScanCode = SCAN_NULL; + + if (TerminalDevice->TerminalType == LINUXTERMTYPE) { + switch (UnicodeChar) { + case '~': + Key.ScanCode = SCAN_DELETE; + break; + } + } + + TerminalDevice->ResetState = RESET_STATE_DEFAULT; + + if (Key.ScanCode != SCAN_NULL) { + Key.UnicodeChar = 0; + EfiKeyFiFoInsertOneKey (TerminalDevice, &Key); + TerminalDevice->InputState = INPUT_STATE_DEFAULT; + UnicodeToEfiKeyFlushState (TerminalDevice); + continue; + } + + UnicodeToEfiKeyFlushState (TerminalDevice); + + break; + + default: // // Invalid state. This should never happen.