public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ruiyu" <ruiyu.ni@Intel.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Leif Lindholm <leif.lindholm@linaro.org>,
	Alexander Graf <agraf@suse.de>,
	 Takahiro Akashi <takahiro.akashi@linaro.org>,
	Rob Clark <robdclark@gmail.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	edk2-devel@lists.01.org
Subject: Re: Implementing EFI_SIMPLE_TEXT_INPUT_PROTOCOL
Date: Thu, 6 Sep 2018 13:27:22 +0800	[thread overview]
Message-ID: <dfe34632-a975-1d40-524a-886dd42bc82b@Intel.com> (raw)
In-Reply-To: <43d78bc7-75d8-3133-d63c-18658c65bce1@gmx.de>

On 9/6/2018 11:27 AM, Heinrich Schuchardt wrote:
> Hello Ruiyu,
> 
> currently I am struggling a bit with interpreting the UEFI spec
> concerning the EFI_SIMPLE_TEXT_INPUT_PROTOCOL.
> 
> In UEFI spec 2.7. chapter 12.1.2 ConsoleIn Definition there is this
> sentence:
> 
> "Only the control characters defined in Table 100 have meaning in the
> Unicode input or output streams."
> 
> Table 100:
> 
> U+0000 Null character ignored when received.
> U+0008 Backspace. Moves cursor left one column.
> U+0009 Tab.
> U+000A Linefeed. Moves cursor  to the next line.
> U+000D Carriage Return. Moves cursor to left margin of the current line.
> 
> Rob interpreted this in a patch for U-Boot such that he simply
> suppressed all other Unicode characters in the 0x00-01F range except for
> special treatment of 0x001b as ESC.
> 
> When I look at EDK2 function USBKeyboardReadKeyStroke()
> (MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c:700) it seems that EDK2 would
> pass CTRL+C as Unicode character U+0003 (cf. your patch 608817ad7114
> "Change the SimpleTextInEx implementation to return CTRL+C").
> 
> The same seems to be the case in function KeyboardReadKeyStroke()
> (MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c:265).
> 
> So do I get it right that for CTRL+A to CTRL+Z we should return a value
> U+0001 - U+001a in Key->UnicodeChar and table 100 is about meaning of
> control characters only and does *not* prescribe a filter?
The reason to return U+0003 for CTRL+C because SimpleTextIn cannot 
return the CTRL state so it uses U+0003 to tell caller that CTRL+C is 
pressed. I think your interpretation to the spec is right.

> 
> But what about CTRL+[ - CTRL+_ ? Why are they suppressed in the EDK2
> keyboard drivers? How do we enter U+001c - U+001f?
Good question. I didn't think about how to translate CTRL+[ and etc.
The patch I made 7 years ago was to meet the purpose how to tell caller 
the CTRL+[ALPHA] is pressed. There was no requirement to tell caller 
whether CTRL+[ (etc.) is pressed at that moment.
I think since SimpleTextInEx is introduced in UEFI Spec, which can 
return more precise key state/toggle information, caller should use the 
Ex version.
I think it's ok for your driver to translate CTRL+[. I doubt any 
consumer code cares about that.

> 
> Best regards
> 
> Heinrich
> 


-- 
Thanks,
Ray


      reply	other threads:[~2018-09-06  5:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  3:27 Implementing EFI_SIMPLE_TEXT_INPUT_PROTOCOL Heinrich Schuchardt
2018-09-06  5:27 ` Ni, Ruiyu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfe34632-a975-1d40-524a-886dd42bc82b@Intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox