From patchwork Wed Nov 11 17:05:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 542963 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C3F1E1402D1 for ; Thu, 12 Nov 2015 04:06:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=F3rlCqQo; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 760E64B768; Wed, 11 Nov 2015 18:06:22 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yqm_eFL3JyyS; Wed, 11 Nov 2015 18:06:22 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D6B2C4B723; Wed, 11 Nov 2015 18:06:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 826DE4B72F for ; Wed, 11 Nov 2015 18:06:10 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GiynOxTOhwlK for ; Wed, 11 Nov 2015 18:06:10 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ig0-f170.google.com (mail-ig0-f170.google.com [209.85.213.170]) by theia.denx.de (Postfix) with ESMTPS id 1DC5D4B727 for ; Wed, 11 Nov 2015 18:06:06 +0100 (CET) Received: by igbhv6 with SMTP id hv6so25040319igb.0 for ; Wed, 11 Nov 2015 09:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8Y5wxIp3C97dKo7cCCCjWgrhe6Jg0++VI6Q/Pa1fy5Q=; b=F3rlCqQoV1H9lnbtRHhkZgByJzqm+yajMGAJjOaW6POnzwnbCzsh2MpDk4k+ZodqUO XnpZr9tcgYVxhP8h86ht2zOQq8sIxaCl9KpN25Teyxy9cuyS/cT9PsptBEQV21QhFW1n mseBrnI9Dmp3hy6NV2PAqsepJrSb+NEE5QkBiAdez1yLq5fIbfQzmEj89CNxiwdGspK6 V6PEfSWBf7vnxItbA1GhtU/FWr9hGBkn9AY/YLpYZjCcKyknopmaHo3qMpvOauO7d8cP lKDexeejyVQE1zIVcqfN6jgDu70+v9iZ0dmVUhyGBFUB5ll6ZNbWgj/smpHGYKWaM+SD oB/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8Y5wxIp3C97dKo7cCCCjWgrhe6Jg0++VI6Q/Pa1fy5Q=; b=OJDPp0OKNsSxd4nhO2SYQgRTt0yu679bfJUkixKKS+fON6D0EbCPRRR1tE3NqZfamj DD9gnCpA5H87VCIYjL6kUmFtWEtwYrMyFjcus2JWcAJfDTK9awcdH8euV1XH9zsrPE6s 9sFTogu/iY+QqYvrBbObfXRs+KL106E3hRc/zG7I2o3Qwry87Igif75jaX3oLNJfK2xR g6gbgUvbcxjOHl/ror7atzYMceB1cKmiVBGyZ1tlenAd58Uth+050mPqGfWqRYwsIwbY FA6WQVuPF8jJbS5E1jDVEUEu6veuiPIEmEbwcj19GjxYTt7RFdJkpVtUTZi/EYWPAEIu lV8g== X-Gm-Message-State: ALoCoQnk/wclNBDOIPcswoKvRXIsC9R9OMr5SEItyuLSkIFJF2t90PgnJJ3xIJXcCsdN8ugVcTdH X-Received: by 10.50.183.37 with SMTP id ej5mr3393520igc.95.1447261565466; Wed, 11 Nov 2015 09:06:05 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id 90sm3469885ioq.29.2015.11.11.09.06.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2015 09:06:04 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 40CB7220DE1; Wed, 11 Nov 2015 10:06:03 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Wed, 11 Nov 2015 10:05:39 -0700 Message-Id: <1447261548-14304-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1447261548-14304-1-git-send-email-sjg@chromium.org> References: <1447261548-14304-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH v3 03/12] input: Handle caps lock X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When caps lock is enabled we should convert lower case to upper case. Add this to the input key processing so that caps lock works correctly. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes in v3: None Changes in v2: None drivers/input/input.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 7513226..a8a15c9 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -453,16 +453,19 @@ static int input_keycodes_to_ascii(struct input_config *config, /* Start conversion by looking for the first new keycode (by same). */ for (i = same; i < num_keycodes; i++) { int key = keycode[i]; - int ch = (key < table->num_entries) ? table->xlate[key] : 0xff; + int ch; /* * For a normal key (with an ASCII value), add it; otherwise * translate special key to escape sequence if possible. */ - if (ch != 0xff) { - if (ch_count < max_chars) - output_ch[ch_count] = (uchar)ch; - ch_count++; + if (key < table->num_entries) { + ch = table->xlate[key]; + if ((config->flags & FLAG_CAPS_LOCK) && + ch >= 'a' && ch <= 'z') + ch -= 'a' - 'A'; + if (ch_count < max_chars && ch != 0xff) + output_ch[ch_count++] = (uchar)ch; } else { ch_count += input_keycode_to_ansi364(config, key, output_ch, max_chars);