[BRLTTY] Footsteps towards better accessibility in Linux

Nicolas Pitre nico at fluxnic.net
Sun Apr 13 18:29:47 UTC 2025


On Sun, 13 Apr 2025, Aura Kelloniemi wrote:

> Hi Nicolas and the list,
> 
> On 2025-04-10 at 17:40 -0400, Nicolas Pitre <nico at fluxnic.net> wrote:
>  > Well, just for the function strings alone (excluding standard letter 
>  > mappings) the limit is 256 strings. The default table uses 28 string 
>  > entries only.
> 
> Yes, exactly.
> 
>  > Is this _really_ a limiting factor?
> 
> It is not, if everybody comes up with their custom solution, but it is, if we
> try to define all combinations supported by xterm and other compatible
> emulators. We cannot know what combinations are necessary and for whom.

And to pick a concrete example, what would a CTRL+SHIFT+f do differently 
from an ALT+SHIFT+f?

I do understand having several combinations with the arrow keys, 
PgUp/PgDn, etc. But what would letters do?

> We need to define the following variants: SHIFT, CTRL, CTRL+SHIFT, ALT,
> ALT+SHIFT, ALT+CTRL, ALT+CTRL+SHIFT; so seven variants in total.
> 
> So, to support all function key combinations we need either 196 or 315
> combinations.
> 
> But this is not enough, we need CTRL+SHIFT, ALT+SHIFT, ALT+CTRL+SHIFT for all
> letters, numbers and symbols. This makes about 3 * 49 combinations = 147
> combinations.
> 
> Then we would need CTRL+number combinations, but I think this calculation
> already makes my point, even though it is not exact.

Let me copy some defines from the kernel sources:

#define KG_SHIFT        0
#define KG_ALTGR        1
#define KG_CTRL         2
#define KG_ALT          3
#define KG_SHIFTL       4
#define KG_SHIFTR       5
#define KG_CTRLL        6
#define KG_CTRLR        7
#define KG_CAPSSHIFT    8

#define NR_SHIFT        9

#define NR_KEYS         256
#define MAX_NR_KEYMAPS  256
/* This means 128Kb if all keymaps are allocated. Only the superuser
   may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
#define MAX_NR_OF_USER_KEYMAPS 256      /* should be at least 7 */

#define MAX_NR_FUNC     256     /* max nr of strings assigned to keys */

So let's agree that 128KB worth of key bindings that's a _lot_ already.

There is even support to turn your PC keyboard into a braille keyboard 
if I read the code correctly.

> But I still stick to my opinion that it would be better to support these
> directly, not through function string definitions, as these are supposed to be
> always the same, not something that every user wants to customize.

Sure, I can buy that argument. Then could you provide some reference to 
a formal definition of what those should be? Because otherwise I still 
fail to grasp the scale of the problem.


Nicolas


More information about the BRLTTY mailing list