From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bulatov.me; s=mail; t=1502453046; bh=0rZ6qL0a1o7Zz8px1RbV64i794nRszAKFAfHnm60H2w=; h=From:Subject:Date:References:To:In-Reply-To:Message-Id; b=BFNnxqsfONYOnM4GflJx+fpT9DPafKRvTd2HItt1SIaUO75G31016MjU25IpH+rPf LYbvfhfFbs9AIC6WFIqzXmJX8VAoWEY3QnN5DGpbwxIPioqN3tzTDqQsWi+PTPu7// VPufbczXHN9ygY6ze02hV/SW1Zr6fWP+jZGTqe28= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bulatov.me; s=mail; t=1502453045; bh=0rZ6qL0a1o7Zz8px1RbV64i794nRszAKFAfHnm60H2w=; h=From:Subject:Date:References:To:In-Reply-To:Message-Id; b=mXlG/eGOU6Zy43LP7hkCkLQDPPcPnMMsOWS5ilNfp2R9Gy5CBfKk/+kYenRvrDXbk ry7v+18EP7tDTK9SoHLXRZe6bk9QBmg/syLJWwmtzKkWfS1cQb3Ls/b1YOsCCBIiuV Q0LpK0yxnPtKn4DPt/Phyk3ijsxl4Ulv/ybycXkM= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@bulatov.me From: Oleg Bulatov Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Date: Fri, 11 Aug 2017 14:04:04 +0200 References: <0b2c4b49-1f28-d87a-205b-0c5c07b79e9c@projektwerkstatt.de> To: kalle , kbd@lists.altlinux.org In-Reply-To: <0b2c4b49-1f28-d87a-205b-0c5c07b79e9c@projektwerkstatt.de> Message-Id: <74B047CD-0665-49B1-92AB-A9386A0E1D50@bulatov.me> X-Mailer: Apple Mail (2.3273) Subject: Re: [kbd] man keymaps X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2017 12:04:12 -0000 Archived-At: List-Archive: Hi, > On 23 Jul 2017, at 07:51, kalle wrote: >=20 > hello, > I have some improvement proposals or unclear points (where explanation > could be improved) for the man 5 keymaps page. > *It would make sense to explain the term 'charset' somewhere > what for is the code produced by a keysym ? How is it related to > character encoding? man 7 charsets Some of them define a character encoding as well (iso-8859-1, koi8-r), = some other don=E2=80=99t (iso-10646-18). > *it would make sense to explain basic terms at the beginning of the > page, e.g. charset, keysym, key(scan-)code The exact definition of these terms are beyond the scope of this man = page. The brief descriptions are provided when necessary: It [charset] defines how following keysyms are to be interpreted. Each of the keysyms represent keyboard actions. keycode keynumber =3D ... keynumber is the internal identification number of the key, roughly = equivalent to the scan code of it. > *keysym: what does the term stand for? why 'symbol=E2=80=99? A key code corresponds roughly to a physical key, while a keysym = corresponds to the symbol on the key top. > what does =E2=80=98keyboard actions' mean? =46rom the man page: The actions available include outputting character codes or character = sequences, switching consoles or keymaps, booting the machine etc. For example: +A, VoidSymbol, Return, Caps_Lock, Compose, AltGr_Lock. > is keyboard induced action possibly better? I don=E2=80=99t think so. > how is this set of actions related to the specific kernel (driver?)? The set of actions has not changed for many years (since Linux 2.0?). = But obviously any action you use has to be supported by kbd and the = kernel. > *'outputting character codes' -> explain more precisely what is meant > here by 'character codes=E2=80=99 What can be more precise than character code? > *first the term 'keysyms' should be explained in detail, before > explaining special keysyms as modifiers are, e.g. the section "keysyms > can be given in decimal, octal" should be before the modifier part Suppose you want to change behaviour of one key on your keyboard. The = current narration first helps you to find what you should change in a = key map, and then how it should be changed. > *the modifier-part is in my opinion badly explained - I roughly = propose > the following: > to every key there are 2^8=3D256 (?) possibilities/modes of outputting > symbols (defined by the kernel driver?) > The 2^8 modes can be represented by eight binary digits, or = interpreted > as a binary number with 8 (?) digits, e.g. 010000101. The first digit > standing , the last one for units of 2^0=3D1, in this example > 0*2^7+0*2^6+0*2^5+0*2^4+0*2^3+1*2^2+0*2^1+1*2^0=3D133. > The different digits are called modifiers, since by combination of all > their different states (0 or 1) they are able to produce 256 (?) = modes, > where the default one is when all modifiers are off (=3D0) so 00000000 > binary is also 0 decimal number. These modifiers are keysyms thus = their > state can be changed by typing some keys and out of historical > development have been given following names: >=20 > modifier name power of 2 = decimal value >=20 > Shift 0 1 > AltGr Alternate Graph 1 2 > ics > Control 2 4 > Alt 3 8 > ShiftL left Shift key 4 16 > ShiftR right Shift key 5 32 > CtrlL left Control key6 64 > CtrlR right Control k.7 128 > CapsShift 8 256 I found the current explanation easier to understand. I want to change behaviour of Ctrl+Shift+A. Let's see: The effective action of a key is found out by adding up the weights of = all the modifiers in effect. Ok, 4+1 =3D 5, I need to change the 6th column. Hurray! I should not care about binary digits to do this. For those who understand binary arithmetic, it=E2=80=99s obvious why it = works and produces a unique value for each combination. > *I don't understand the example of the part starting with "Note that = you > should be very careful[?]",because it tells that the Control modifier > stays switched on, until it is produced again by typing in the same = key. Let=E2=80=99s say you define your left shift key as keycode 42 =3D Shift A Then the key down event will be handled as Shift and next actions will = be taken from the 2nd column. Which means the key up event will be = handled as the =E2=80=98A=E2=80=99 key. So from the kernel's point of = view the shift key isn=E2=80=99t released. And if you have not any Shifts in the second column, you cannot = =E2=80=98release=E2=80=99 the shift key anymore. > *To the sentence "these are actually being defined" add "by the map > specification line, see above=E2=80=9D > *to "it has a special meaning" add: "to loadkeys (1)"? Everything in this man page is for loadkeys. > greetings, > kalle --=20 WBR, Oleg