From nobody Sun Jan 29 15:10:31 2023 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P4ZWK09v9z3ckbt for ; Sun, 29 Jan 2023 15:10:37 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4P4ZWJ5JL2z4FSV for ; Sun, 29 Jan 2023 15:10:36 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; none Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B2CEC5C0D93; Sun, 29 Jan 2023 10:10:34 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 29 Jan 2023 10:10:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1675005034; x= 1675091434; bh=Dr/druN9VwzKqvBK1NuqmQL3/EnYzOkdQq8eJGvtIFg=; b=s e4xP1RMAxkC/g19koHKOAwj5UjWcaYspexfuPXgMlaVLFuqZV58Bsb+dnZ8iQxav gz3bJtouxcGCeTyJsK+c40ut5N3CnuMa7iaZa5AaB6w2h+ENY4o2SxAhPS1bAbx/ 0R8feCbjvNI8b0VnUQCvmUC5o/ytjTaZ6HuP4VMBqTl7b2qWWHFEG+ztK4s6mM1y 5aO2L/60xzkxTUVhByiQHkwNVuXpfja5QVTN53gY1D/sZlBW4onAR++zByNFW2p4 MYtK5+uyQAtN65b6DhQ0EbexyBwmo2spixBTe1O46mdmVjPjBeB5gne6mPxJvzAr pyHH5RdJ8LXRwdUFFUXkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1675005034; x=1675091434; bh=D r/druN9VwzKqvBK1NuqmQL3/EnYzOkdQq8eJGvtIFg=; b=T6hvKNOFLKy+Q1pPs sgRNbo8sK6Fw24FHeNEeeJwS2KswlPBeITnVLP03AZ240SOfL/4gzH7647iZOT6R DRvAxI2iE2A7Sm2LxQnPejVlrIXs/H+BQF6QIo+mSWlYRjw/kSO0AEnwxMxaOCxZ Lmyq4hDP1UgWT3CXSXl2VdjWqcScNeXGlUTNVmsMOcROAYU7y2woXRXgMoWH3kQf DTUiqg/EHNWQw/HLN5s3eUvQ2FJtYfs62zVJnLMlS7uTEM92+NWgHFeG1BYkJaNp ABmLijTof/Xe2eaRY/CeCIoUvr/JjbS0FgFgSAbRR8UYds2xUp6ToQ9Bv9gfS92x gJ8KQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeftddgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpegjuhhrihcuoeihuhhrihesrggvthgvrhhnrdhorhhgqeen ucggtffrrghtthgvrhhnpeehtdekheefleeuhefgueetgeevueektddutdegfffhueeute elgeeiteevjeeuveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpeihuhhrihesrggvthgvrhhnrdhorhhg X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Jan 2023 10:10:33 -0500 (EST) Message-ID: <37e0cdef-d3f9-e6d9-2368-5bff0bdbe6c1@aetern.org> Date: Sun, 29 Jan 2023 16:10:31 +0100 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: vt and keyboard accents Content-Language: en-US To: Hans Petter Selasky , current@freebsd.org References: <70f53d17-46eb-c299-1a93-bf28858c1685@aetern.org> <842fe9a7-ec72-7557-72b0-4054cf770a5d@aetern.org> From: Yuri In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4P4ZWJ5JL2z4FSV X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Hans Petter Selasky wrote: > On 1/29/23 09:48, Yuri wrote: >> Hans Petter Selasky wrote: >>> On 1/29/23 01:54, Yuri wrote: >>>> Looking into an issue with accents input for vt and cz (so >>>> /usr/share/vt/keymaps/cz.kbd) keyboard where some of the accents are >>>> working and other result weird unrelated characters output. >>>> >>>> Checking kbdcontrol -d output, there is an obvious difference with >>>> keymap contents -- all mappings are trimmed down to 1 byte after >>>> reading: >>>> >>>> kbdcontrol: >>>>     dacu  180  ( 180 180 ) ( 'S' 'Z' ) ( 'Z' 'y' ) ( 's' '[' ) >>>>                ( 'z' 'z' ) ( 'R' 'T' ) ( 'A' 193 ) ( 'L' '9' ) >>>>                ( 'C' 006 ) ( 'E' 201 ) ( 'I' 205 ) ( 'N' 'C' ) >>>>                ( 'O' 211 ) ( 'U' 218 ) ( 'Y' 221 ) ( 'r' 'U' ) >>>>                ( 'a' 225 ) ( 'l' ':' ) ( 'c' 007 ) ( 'e' 233 ) >>>>                ( 'i' 237 ) ( 'n' 'D' ) ( 'o' 243 ) ( 'u' 250 ) >>>>                ( 'y' 253 ) >>>> >>>> keymap: >>>>     dacu 0xb4    ( 0xb4   0xb4    ) ( 'S'    0x015a  ) ( 'Z'    >>>> 0x0179  ) >>>> ( 's'    0x015b  ) >>>>                  ( 'z'    0x017a  ) ( 'R'    0x0154  ) ( 'A'    >>>> 0xc1    ) >>>> ( 'L'    0x0139  ) >>>>                  ( 'C'    0x0106  ) ( 'E'    0xc9    ) ( 'I'    >>>> 0xcd    ) >>>> ( 'N'    0x0143  ) >>>>                  ( 'O'    0xd3    ) ( 'U'    0xda    ) ( 'Y'    >>>> 0xdd    ) >>>> ( 'r'    0x0155  ) >>>>                  ( 'a'    0xe1    ) ( 'l'    0x013a  ) ( 'c'    >>>> 0x0107  ) >>>> ( 'e'    0xe9    ) >>>>                  ( 'i'    0xed    ) ( 'n'    0x0144  ) ( 'o'    >>>> 0xf3    ) >>>> ( 'u'    0xfa    ) >>>>                  ( 'y'    0xfd    ) >>>> >>>> Source of the problem is the following definition in sys/sys/kbio.h: >>>> >>>> struct acc_t { >>>>           u_char          accchar; >>>>           u_char          map[NUM_ACCENTCHARS][2]; >>>> }; >>>> >>>> While the keymaps were converted to have the unicode characters for vt >>>> in the commit below, the array to store them (map) was missed, or was >>>> there a reason for this? >>>> >>>> --- >>>> commit 7ba08f814546ece02e0193edc12cf6eb4d5cb8d4 >>>> Author: Stefan Eßer >>>> Date:   Sun Aug 17 19:54:21 2014 +0000 >>>> >>>>       Attempt at converting the SYSCONS keymaps to Unicode for use with >>>> NEWCONS. >>>>       I have spent many hours comparing source and destination formats, >>>> and hope >>>>       to have caught the most severe conversion errors. >>>> --- >>>> >>>> I have tried the following patch and it allows me to enter all accents >>>> documented in the keymap, though I must admit I'm not sure it does not >>>> have hidden issues: >>>> >>>> diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h >>>> index 7f17bda76c5..fffeb63e226 100644 >>>> --- a/sys/sys/kbio.h >>>> +++ b/sys/sys/kbio.h >>>> @@ -200,7 +200,7 @@ typedef struct okeymap okeymap_t; >>>> >>>>    struct acc_t { >>>>           u_char          accchar; >>>> -       u_char          map[NUM_ACCENTCHARS][2]; >>>> +       int             map[NUM_ACCENTCHARS][2]; >>>>    }; >>>> >>> >>> Hi, >>> >>> Using "int" for unicode characters is probably good for now. Your patch >>> looks good, but please also consider the "umlaut" case while at it >>> (multiple characters that become one)! >> >> I think umlauts are already part of "accents" (duml keyword), e.g. in >> cz.kbd: >> >>    duml 0xa8    ( 0xa8   0xa8    ) ( 'A'    0xc4    ) ( 'E'    0xcb    ) >> ( 'O'    0xd6    ) >>                 ( 'U'    0xdc    ) ( 'a'    0xe4    ) ( 'e'    0xeb    ) >> ( 'o'    0xf6    ) >>                 ( 'u'    0xfc    ) >> >> So pressing Alt+Shift and "=/+" key, and then pressing one of AEOUaeou >> keys would produce ÄËÖÜäëöü, respectively, and it currently works as all >> of the ÄËÖÜäëöü characters can be written as single-byte unicode. >> >> And the following dcar (that is, "caron") characters are all broken as >> they need at least 2 bytes, pressing Shift and "=/+" key, and any of the >> LSTZlstzCEDNRcednrUu would print nothing at all, produce garbage, or >> print some control character (last byte only): >> >>    dcar 0x02c7  ( 0x02c7 0x02c7  ) ( 'L'    0x013d  ) ( 'S'    0x0160  ) >> ( 'T'    0x0164  ) >>                 ( 'Z'    0x017d  ) ( 'l'    0x013e  ) ( 's'    0x0161  ) >> ( 't'    0x0165  ) >>                 ( 'z'    0x017e  ) ( 'C'    0x010c  ) ( 'E'    0x011a  ) >> ( 'D'    0x010e  ) >>                 ( 'N'    0x0147  ) ( 'R'    0x0158  ) ( 'c'    0x010d  ) >> ( 'e'    0x011b  ) >>                 ( 'd'    0x010f  ) ( 'n'    0x0148  ) ( 'r'    0x0159  ) >> ( 'U'    0x016e  ) >>                 ( 'u'    0x016f  ) > > Hi Yuri, > > Do you happen to know if we currently support these Norwegian-only umlauts? > > For example written as "umlauts": > > å b̊ c̊ > > Only the single-characters å and Å are of interest in the Norwegian > language. Looking at the share/vt/keymaps/no.kbd we don't, but if I understood you correctly and only å/Å are required, it should be easy to add: diff --git a/share/vt/keymaps/no.kbd b/share/vt/keymaps/no.kbd index 710563917fa4..94c3621396dc 100644 --- a/share/vt/keymaps/no.kbd +++ b/share/vt/keymaps/no.kbd @@ -33,7 +33,7 @@ 027 0xa8 '^' rs rs '~' '^' rs rs O 028 cr cr nl nl cr cr nl nl O 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O - 030 'a' 'A' soh soh 0xe1 0xc1 soh soh C + 030 'a' 'A' soh soh 0xe1 0xc1 0xe5 0xc5 C 031 's' 'S' dc3 dc3 0xdf 0xdf dc3 dc3 C 032 'd' 'D' eot eot 0xf0 0xd0 eot eot C 033 'f' 'F' ack ack 0xaa 0xaa ack ack C Pressing Ctrl+AltGr+a will produce å now, with Shift for Å.