Hello,

>  19 files changed, 547 insertions(+), 5803 deletions(-)

Yay, nice cleanup :D

Did you try to run Xorg with this patch applied?

Did you check that it builds when xkb_common is not available?

Did you try to use compose?

Do you have a patch for debian's /etc/default/hurd-console file?

Etienne Brateau, le sam. 09 mars 2024 01:48:34 +0100, a ecrit:
> diff --git a/console-client/pc-kbd.c b/console-client/pc-kbd.c
> index aa5f1103..8ca36793 100644
> --- a/console-client/pc-kbd.c
> +++ b/console-client/pc-kbd.c
> @@ -805,30 +799,17 @@ input_loop (void *unused)
>          {
>            keypress_t key;
>  
> -          key.keycode = read_keycode () + min_keys;
> -          key.rel = key.keycode & 0x80;
> -          key.redir = 0;
> -
> -          if (!key.rel && key.keycode == prevkey)
> -            key.repeat = 1;
> -          else
> -            key.repeat = 0;
> +          keycode_t raw_keycode = read_keycode () + get_min_keycode();
> +          key.keycode = raw_keycode & ~0x80;
> +          key.rel = raw_keycode & 0x80;
>  
> -          if (key.repeat)
> +          /* don’t allow repeated key */
> +          if (raw_keycode == prevkey)
>              continue;

You can move this above filling key.

> -    {"xkbdir",     'x', "DIR",          0, 
> -     "Directory containing the XKB configuration files" },
> -    {"keymapfile", 'f', "FILE",         0,
> -     "File containing the keymap" },
> -    {"keymap",     'k', "SECTIONNAME" , 0,
> -     "Choose keymap"},
> +    {"model",      'm', "XKB_MODEL",           0,
> +     "the keyboard model for xkb" },
> +    {"layout",     'l', "XKB_LAYOUT",          0,
> +     "The layout of the keyboard" },
> +    {"variant",    'v', "XKB_VARIANT" ,        0,
> +     "The variant to use"},
> +    {"options",    'p', "XKB_OPTIONS" ,        0,
> +     "The xkb options"},
>      {"compose",    'o', "COMPOSEFILE", 0,
>       "Compose file to load (default none)"},
>      {"ctrlaltbs",  'c', 0                 , 0,
> @@ -1235,17 +1219,21 @@ parse_opt (int key, char *arg, struct argp_state 
> *state)
>      {
>  #ifdef XKB_SUPPORT
>      case 'x':

This should be made 'm'?

> diff --git a/console-client/xkb/xkb.c b/console-client/xkb/xkb.c
> index f0c36a64..5046c747 100644
> --- a/console-client/xkb/xkb.c
> +++ b/console-client/xkb/xkb.c
> +int
> +execute_action(keycode_t keycode)
>  {
[...]
>  
> -  if (actioncompl == KEYCONSUMED && !key.rel)
> +  if (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, 
> XKB_STATE_MODS_EFFECTIVE) > 0)
>      {

The values for XKB_KEY_F1 ... XKB_KEY_F35 are fixed and happen to be
consecutive, so you can factorize these:

>    /* Special key, generate escape sequence.  */
>    char *escseq = NULL;
>  
>    switch (input)
>      {
> -    case XK_Up: case XK_KP_Up:
> -      escseq = CONS_KEY_UP;
> +      case XKB_KEY_Up:
> +      case XKB_KEY_KP_Up:
> +        escseq = CONS_KEY_UP;

The GNU coding standard says it's to be like it was before:

    {
    case XKB_KEY_Up:
    case XKB_KEY_KP_Up:
      escseq = CONS_KEY_UP;
      break;

and similar for the rest.

> @@ -1323,60 +446,138 @@ xkb_input (keypress_t key)
>      {
>        char *buffer = &buf[size];
>        size_t left = sizeof (buf) - size;
> -      char *inbuf = (char *) &input;
> -      size_t inbufsize = sizeof (wchar_t);
> -      size_t nr;
> +      int nr;
>  
>        /* Control key behaviour.  */
> +      if (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, 
> XKB_STATE_MODS_EFFECTIVE) > 0)
> +        {
> +          input = symtoctrlsym (input);
> +          buffer[0] = input;
> +          buffer[1] = '\n';

Why \n?

Samuel

Reply via email to