Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-05-11 15:20:06

jt1122
Member
Registered: 2021-03-26
Posts: 240

Key remapping per terminal

Hi,

Can keys be remapped only within an xfce-terminal window?.
For example Alt-A would produce Ctrl-A.

I don't want global remapping (e.g., xmodmap) .

Thanks

Offline

#2 2023-05-11 16:58:40

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,177

Re: Key remapping per terminal

What does Alt-A / Ctrl-A do in this context?

Is it just a matter of mapping the shortcut keys? If so, then you can remap the shortcuts keys (~/.config/xfce4/terminal/accels.scm) or the shortcut editor in the newer version.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2023-05-11 17:16:48

jt1122
Member
Registered: 2021-03-26
Posts: 240

Re: Key remapping per terminal

Thanks.

I'll clarify what I meant:

I'm using a text-based app ( e.g. browser ) in an xfce-temrinal.
The app allows to define custom key-bindings but it doesn't support certain combinations, e.g. ctrl-A is recognized but not alt-A.

My question is: can I somehow make xfce-terminal convert alt-A -> ctrl-A so that pressing alt-a would "send" ctrl-A to whatever is running there?. I want this done "locally" only within that xfce-terminal instance.

Cheers

Offline

#4 2023-05-11 18:11:01

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,177

Re: Key remapping per terminal

You can use the "bind" command to bind one shortcut to another:

bind '"\ea":"\C-a"'

..."\e" refers to the Alt key and "\C" refers to the control key. I'm assuming you meant lowercase 'a' in your example.

This will only take effect in the local terminal instance.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2023-05-11 19:05:06

jt1122
Member
Registered: 2021-03-26
Posts: 240

Re: Key remapping per terminal

Thanks.

But bind is used by readline.
When some app runs which doesn't rely on readlinr that won't work.

Say for example nano uses .nanorc for its keybindings. If it's run in a  the terminal readline has no effect on what key combinations nano receives.

Offline

#6 2023-05-13 08:41:45

jt1122
Member
Registered: 2021-03-26
Posts: 240

Re: Key remapping per terminal

bumping.

Offline

#7 2023-05-13 10:22:32

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,177

Re: Key remapping per terminal

What about using a third-party tool like xremap?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2023-05-13 10:34:01

jt1122
Member
Registered: 2021-03-26
Posts: 240

Re: Key remapping per terminal

Thanks, I'll look into it.

Last edited by jt1122 (2023-05-13 10:36:03)

Offline

Board footer

Powered by FluxBB