You are not logged in.

#1 2021-11-10 12:15:41

Pena
Member
Registered: 2019-10-04
Posts: 107

[SOLVED]How to bind a sequence of keys to output a ascii character

So i got this new 60% keyboard and i really love it, unfortunately it was heavily designed for a US layout with only the most changed keys being programable, which me being Portuguese means that when i set it to use a portuguese layout the "<" and ">" disappear (since these are an extra key located between the shift and z key)

I've tried looking into the arch linux wiki, although i had no sucess in doing so, i have various bind sequences in mind but i haven't chosen one specifically, here's my .XCompose
```
include "/usr/share/X11/locale/en_US.UTF-8/Compose"
<dead_acute> <C>        : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
<dead_acute> <c>        : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
```
I've erased my tries but what i previously tried was doing simple binds like the one presented by the forum, doing `[ CTRL | META | SHIFT ] <z> : "<" less` or `<Multi_key> <z> <z> : "<" less`

Also i have 2 keyboards(the integrated laptop one and the external one) so whenever i remove and plug it again, i have to do a setxkbmap pt once again

Last edited by Pena (2021-11-17 12:30:37)

Offline

#2 2021-11-10 15:01:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

<Multi_key> <z> <z>  : "<"

is going to work, but you need a multi key (caps lock?)
Also you must be using xim (what GTK by default does NOT!)

export GTK_IM_MODULE="xim"

I'm not sure whether your keyboard provides a 3rd level shift (altgr), otherwise you could map altgr+z there (eg. using xmodmap)

nb. that the XCompose entries will only impact new processes

so whenever i remove and plug it again, i have to do a setxkbmap pt once again

https://wiki.archlinux.org/title/Xorg/K … tion_files
You can also use "MatchProduct" (the product label can be obtained from "xinput")

Offline

#3 2021-11-10 15:10:58

Pena
Member
Registered: 2019-10-04
Posts: 107

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

seth wrote:
<Multi_key> <z> <z>  : "<"

is going to work, but you need a multi key (caps lock?)
Also you must be using xim (what GTK by default does NOT!)

export GTK_IM_MODULE="xim"

I'm not sure whether your keyboard provides a 3rd level shift (altgr), otherwise you could map altgr+z there (eg. using xmodmap)

nb. that the XCompose entries will only impact new processes

so whenever i remove and plug it again, i have to do a setxkbmap pt once again

https://wiki.archlinux.org/title/Xorg/K … tion_files
You can also use "MatchProduct" (the product label can be obtained from "xinput")

Im using openbox so i read it but got past it since it didnt rang my alert, on 3rd level shift on z currently its binded to «« although this character is a duplicate

also is nb: "no bother" or nota bene which is pay attention

Last edited by Pena (2021-11-10 15:14:31)

Offline

#4 2021-11-10 16:14:32

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

"nota bene", I'm an ancient god tongue

Is there an open question in this thread?

Offline

#5 2021-11-11 18:08:27

Pena
Member
Registered: 2019-10-04
Posts: 107

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

seth wrote:

"nota bene", I'm an ancient god tongue

Is there an open question in this thread?

well yes i exported it on my .profile checked to see if it was there rebooted with this ` <Multi_key> <g> <a> : "α"  ` as just a way to check if it worked and no matter the key combo i did i couldn't get it to make an alpha appear i even tried to using meta/ global key and alt since i could be misguiding myself but nop so im still with the same problem

Offline

#6 2021-11-11 20:10:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

Export what in your .profile ?
The xim sequences belong into ~/.XCompose

What did you set as your compose/Multi_key ?

setxkbmap -print -query
xmodmap -pk | grep Multi_key

https://wiki.archlinux.org/title/Xorg/K … ompose_key

Offline

#7 2021-11-11 22:06:48

Pena
Member
Registered: 2019-10-04
Posts: 107

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

seth wrote:

Export what in your .profile ?
The xim sequences belong into ~/.XCompose

What did you set as your compose/Multi_key ?

setxkbmap -print -query
xmodmap -pk | grep Multi_key

https://wiki.archlinux.org/title/Xorg/K … ompose_key

xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+pt+inet(evdev)"     };
        xkb_geometry  { include "pc(pc105)"     };
};
rules:      evdev
model:      pc105
layout:     pt

Also you have to set up a multi key? that explains a lot since i didn't do any of that

Last edited by Pena (2021-11-11 22:07:14)

Offline

#8 2021-11-12 07:44:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

If you want to use the multi_key as part of an input sequence, you'll have to be able to press one, yes…
I "sacrifice" caps-lock, since it's the most useless key on any keyboard anyway and a residual from times when it took 1lb pressure to hold down a key on ancient typewriters.

Offline

#9 2021-11-12 08:34:24

Pena
Member
Registered: 2019-10-04
Posts: 107

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

seth wrote:

If you want to use the multi_key as part of an input sequence, you'll have to be able to press one, yes…
I "sacrifice" caps-lock, since it's the most useless key on any keyboard anyway and a residual from times when it took 1lb pressure to hold down a key on ancient typewriters.

bad new's as previously referenced im on a 60% keyboard meaning half the key's are gone including the cap's however i think the right shift key is pretty useless so whats the code line to bind everything?

Offline

#10 2021-11-12 08:56:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

"60%" is not a standard and there're several "60%" keyboards w/ a caps-lock key.
xkb rules are in

grep -ir compose /usr/share/X11/xkb/rules

but there're none for the shift keys, so you'd have to derive a special xkb layout or bind the keycode w/ xmodmap (you can check the keycode w/ "xev -event keyboard", r_shift is probably 62 but make sure that your keyboard actually has to shift codes and not just two physical keys producing the same code!)

Offline

#11 2021-11-12 10:34:24

Pena
Member
Registered: 2019-10-04
Posts: 107

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

seth wrote:

"60%" is not a standard and there're several "60%" keyboards w/ a caps-lock key.
xkb rules are in

grep -ir compose /usr/share/X11/xkb/rules

but there're none for the shift keys, so you'd have to derive a special xkb layout or bind the keycode w/ xmodmap (you can check the keycode w/ "xev -event keyboard", r_shift is probably 62 but make sure that your keyboard actually has to shift codes and not just two physical keys producing the same code!)

alright so i pasted this in my terminal

grep -ir compose /usr/share/X11/xkb/rules

and got the lwin key so i put this like:
<lwin> <g> <a> : "α"
And nothing... also you are right, the right shift is 62 and its different from the left one

Last edited by Pena (2021-11-12 12:15:59)

Offline

#12 2021-11-12 14:07:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,223

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

Of course not…

setxkbmap -options compose:lwin

will temporarily turn lwin into the Multi_key and then you use

<Multi_key> <g> <a>  : "α"

in your ~/.XCompose

Maybe try to read the links that I posted in this thread…

Offline

#13 2021-11-17 12:29:09

Pena
Member
Registered: 2019-10-04
Posts: 107

Re: [SOLVED]How to bind a sequence of keys to output a ascii character

seth wrote:

Of course not…

setxkbmap -options compose:lwin

will temporarily turn lwin into the Multi_key and then you use

<Multi_key> <g> <a>  : "α"

in your ~/.XCompose

Maybe try to read the links that I posted in this thread…

well its solved, the thing was that i was skipping a huge detail... multi key's work like accent's not like macro's what i was doing was pressing them all at the same time, that and not having set the key for multi_key, i should actually start to read the forums in the section i want instead of just skipping every other word

Offline

Board footer

Powered by FluxBB