From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 14 12:28:45 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73A94AC5; Thu, 14 Aug 2014 12:28:45 +0000 (UTC) Received: from mailout05.t-online.de (mailout05.t-online.de [194.25.134.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 214542EEB; Thu, 14 Aug 2014 12:28:44 +0000 (UTC) Received: from fwd06.aul.t-online.de (fwd06.aul.t-online.de [172.20.26.150]) by mailout05.t-online.de (Postfix) with SMTP id 121D23C404E; Thu, 14 Aug 2014 14:21:47 +0200 (CEST) Received: from [192.168.119.33] (X7Fk+ZZJgh49SMOJ8ambL4TSIJHDu3Jo8Dq6ErcXlrWOQ6iJB5Ipqnaqc7tsxqvZvc@[84.154.101.219]) by fwd06.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1XHu2J-2exh3o0; Thu, 14 Aug 2014 14:21:43 +0200 Message-ID: <53ECA9CE.3070106@freebsd.org> Date: Thu, 14 Aug 2014 14:21:34 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Ed Maste Subject: Re: Keymap definitions for VT / NEWCONS References: <53EA0EC2.2070601@freebsd.org> <53EA1E5A.5020707@FreeBSD.org> <53EA2D00.7010307@freebsd.org> <53EB0DA0.5000305@freebsd.org> <53EBEDC8.3080303@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-ID: X7Fk+ZZJgh49SMOJ8ambL4TSIJHDu3Jo8Dq6ErcXlrWOQ6iJB5Ipqnaqc7tsxqvZvc X-TOI-MSGID: 18053e4a-8484-4542-8069-c59e96545eec Cc: "Andrey V. Elsukov" , Aleksandr Rybalko , "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 12:28:45 -0000 Am 14.08.2014 um 05:14 schrieb Ed Maste: > On 13 August 2014 18:59, Stefan Esser wrote: >> >> And I think it is better to use locale names in any case. The >> selection logic has to be there for locales, why complicate >> matters by introducing 2-letter names, which in fact match >> the 2nd half of a locale name when country code and language >> code don't match (as in "en_US.kbd" vs "us.kbd"). >> >> I think we should provide keymap files under the same names >> as the locale names (less the encoding). > > But there isn't a 1:1 mapping between locales and keyboard maps, since > we have to deal with some special cases (like dvorak). We should let > the end user independently choose the language (for interacting with > the installer), keymap, and locale anyway, even though in most cases > there is a straightforward mapping between them. So I don't think it > makes much difference if we have a keymap called fr.kbd for example, > or a different name. There probably won't be a 1:1 mapping for all cases, but I think that there is value in going for a regular naming scheme. We can use "fr.kbd" as a short form of "fr_FR.kbd", but there will be a "fr_CH.kbd" and possibly a "fr_CA.kbd". The "fr" in the short form will correspond to the "FR" in "fr_FR.kbd", which is hidden by the fact, that both parts read "fr". But look at "uk_UA.kbd", which will be short-named as "ua.kbd", or "be_BY.kbd" mapped to "by.kbd" versus "nl_BE.kbd" mapped to "be.kbd". For some language/country combinations, the short form ends up in a distant location to the long form names. And will there be a "ch.kbd" for "de_CH.kbd" (the majority of Swiss users will use that keymap), or will they all be of the form "??_CH.kbd" ... ??? For all these reasons I think the short form serves no real purpose. If you want to support it, you could symlink a short name to the locale based name (to allow the use of just the country code, if people edit rc.conf by hand, while I'd expect the installer to use the locale based keyboard names). >> We'll need a mapping file (like "INDEX.keymaps" for syscons), >> I assume. > > I wouldn't necessarily call INDEX.keymaps a mapping file; it's just > used for the menu-driven keymap selection. I think we can use the > exact same scheme and file format for vt(4). Yes, I know its purpose and I agree, that the format should be usable for NEWCONS keymaps, too. We'd just need to teach it about the two supported drivers and make it select the correct path for SYSCONS vs. NEWCONS (based on the sysctl). I think this should be implemented in time for 10.1, if at all possible. Changes required are: - Selection of NEWCONS/SYSCONS pathes and defaults: * DEFAULT_KEYMAP_DIR * DEFAULT_FONT_DIR * DEFAULT_FONT * DEFAULT_LANG We may want to introduce a new rc.conf variable for NEWCONS, since the format has changed (e.g. no ".iso." in names). That way, a mapping script could suggest a suitable keymap for NEWCONS, if running under NEWCONS and only a SYSCONS keymap has been defined. And that way, you could reboot into SYSCONS in case of problems with NEWCONS and still have your SYSCONS keymap defined (under the old rc.conf variable name). >> The keymap names are not consistent, as it is now. If we agree, >> that names without ".acc." are "nodeadkey" variants and with >> ".acc." have dead keys for accents and the like, then for some >> locales the ".acc." version will be "normal" and expected by >> users, while its the plain version for other locales. > > Are you proposing that we have a combination of *.kbd, *.acc.kbd, and > *.nodeadkey.kbd variants, depending on which type is the common / > expected case for various layouts? I'd think it was best, if we had a common keymap under the name of the locale (e.g. "en_US.kbd"). This keymap should work as expected by users, which in case of e.g. the German keyboard means, that a few accents are deadkeys, while most keys are of the "nodeadkeys" variant. E.g. ^ on my keyboard is used as an accent and needs a blank typed after it to appear on its own, while ~ is not considered an accent, but a "normal" character. (And ´ and ` are accents, while ° and ' are characters.) On the Swiss-German keymap, other characters are expected to work as accents or just as characters. A nodeadkeys variant makes no sense in Switzerland, while it might be of use in Germany (where the accents are only used to write foreign names and the like). >> That's why I suggested to follow some other system (e.g. Windows) >> use of accent keys / dead keys. Users in the respective locales >> will know and expect the keyboard to behave just this way. > > I think it's important to make a distinction between the way the user > selects a keymap, and the filename. In the common case I think users > will choose a layout from a menu, and won't necessarily see or care > about the filename. I'm not sure what contemporary Windows versions > do with respect to keyboard selection - can you describe the process > it uses? The selection is automatic when you install windows. You'll be asked for the language and the country, and while not being displayed, the selection of the keyboard follows the locale selection. You can switch keyboards, e.g. on a Swiss notebook between de_CH and fr_CH. But the keyboard selection tool does not show the locale in that form, instead it only shows the language part (assuming that the country is known). Staying with the example of the Swiss notebook, I get the choice between "DE" and "FR" keyboards. Only if I select the option to also display text labels, these two variants are named "DE Deutsch (Schweiz)" and "FR Französisch (Schweiz)" (the output locale is "German" in both cases, leading to the display of "Französisch" instead of a locale description in French). If you want to add an alternate keyboard layout, your choices are sorted by language, not by country. E.g. on above mentioned Swiss notebook, invoking the "Add Language" option of the keyboard selection utility places me in the scroll area on "Deutsch (Schweiz)" with "Deutsch (Östereich)" above and "Divehi (Malediven)" below ... I'd have thought, that the sorting by country and then by language was more reasonable, but the list is sorted in the same way as in the MS-Office language option for the spell- checker, for example. This Windows tool provides a similar function our language selection tool. After selecting a locale (language,country), a button list is displayed, which allows to select between one or more layouts for that locale. In the case of "English (USA)" the layouts start with "English (USA, Dvorak, left-handed)" and "English (USA, Dvorak, right-handed)" and continue to "English (USA, international)" and "US". There is no choice of deadkeys vs. nodeadkeys variant for any of the keymaps I looked at, but there appear to be variants with regard to "Shift-Lock" or "Caps-Lock" for a few locales. And there are further specialties, like "Spanish" which exists in "international" and "traditional" layouts. This all looks very similar to a tuple of language and country (while locales are country_LANGUAGE) with optional modifiers for specific layouts (like our ".dvorak." in keymap names). >> And it is really annoying to see my efforts wasted! :( > > I don't think any of your effort is wasted -- my commit was just an > svn copy of the 8 trivial kbd files, as I thought you were working > only on the keymap files needing conversion for Unicode. Anyhow, > changing the naming scheme (if we want to do that) isn't a big deal. > We'd have to deal with pl.kbd and ua.kbd already. Sorry, it was late at night and I really have spent quite some time on the conversion of keymap files. Your commits do no harm, although I had prefered to have agreement on the naming of keymap files. And I still strongly prefer names that are identical to locale names, wherever possible. Most users will either use the installer (and will thus never see the locale IDs), or they'll manually edit rc.conf and will know their way. And then it's easier to mechanically put the locale ID in to the keyboard selection variable, instead of thinking about (or looking up) whether this is a country that does not need the full locale ID to select a keymap. In Europe, you'll often need the locale name, not only the country. If you really think that the 2-character ISO country codes should be available as a short-hand, than I'd really want to install the keymap under the locale name and only add a symlink from the country name. Regarding the files you committed: I had edited all files, including those that do not generate different codes when converted to Unicode, at least in so far as I have removed misleading comments (e.g. claiming that the encoding was ISO5589-*, when Unicode is now universally used). I really think we'll regret using anything but locale names for keymaps, and I'd want to rename those that you committed under 2-letter ISO names. Is that acceptable to you? Regards, STefan