Como eu removo uma tradução padrão xterm X11?

2

Estou usando o xterm, que vem com um conjunto de traduções padrão, conforme enumerado na página man. Para #augment ou #override das traduções, edito meu arquivo $XAPPLRESDIR/XTerm ; isso funciona como esperado.

No entanto, não consigo encontrar uma maneira de remover uma determinada tradução padrão (e ter o evento passado para o aplicativo em execução no xterm).

Especificamente, quero que o evento Meta <Btn2Down> seja passado para o aplicativo. As traduções padrão do xterm associam isso à ação clear-saved-lines() com

DEFAULT KEY BINDINGS
[...]
Meta <Btn2Down>:clear-saved-lines() \n\

O que eu preciso fazer para o aplicativo receber o evento Meta-Btn2Down?

    
por Jens 06.01.2015 / 14:11

2 respostas

1

Pelo que entendi, não há nenhuma função no X Toolkit que possa remover uma tradução. Você pode substituir ou aumentar mas não remover seletivamente uma parte de uma tabela de tradução.

Essa foi uma das razões para adicionar a omitTranslation Recurso no patch # 269 . Com essa versão, a tabela de traduções é dividida em partes mais gerenciáveis, o que permite uma personalização um pouco melhor:

Selectively omit one or more parts of xterm's default translations at startup. The resource value is a comma-separated list of keywords, which may be abbreviated: "fullscreen", "scroll-lock", "shift-fonts" or "wheel-mouse". Xterm also recognizes "default", but omitting that will make the program unusable unless you provide a similar definition in your resource settings.

No entanto, concordando com StéphaneChazelas, não está claro como você usaria efetivamente a mudança proposta porque as seqüências de escape que são passadas para o aplicativo são construídas dentro do xterm com base em eventos de botão. Talvez você possa fazer uma tradução especial que use uma ação de string.

    
por 29.03.2015 / 01:49
0

Se você estiver procurando chaves já conectadas para serem passadas sem manipular o xterm, provavelmente você está procurando por insert() ou insert-eight-bit() actions.

Da página do manual do xterm:

insert()
This action inserts the character or string associated with the key that was pressed.

insert-eight-bit()
This action inserts an eight-bit (Meta) version of the character or string associated with the key that was pressed. Only single-byte values are treated specially. The exact action depends on the value of the altSendsEscape and the metaSendsEscape and the eightBitInput resources. The metaSendsEscape resource is tested first. See the eightBitInput resource for a full discussion.

The term “eight-bit” is misleading: xterm checks if the key is in the range 128 to 255 (the eighth bit is set). If the value is in that range, depending on the resource values, xterm may then do one of the following:

  • add 128 to the value, setting its eighth bit,
  • send an ESC byte before the key, or
  • send the key unaltered.

Por exemplo,

Meta <Btn2Down>:insert-eight-bit() \n\

PS: Acabei de resolver o mesmo problema para evitar o biding Alt <Key>Return:fullscreen() \n\ , para poder passar o Alt-return para uma aplicação.

    
por 08.02.2018 / 15:06