You are not logged in.

#1 2023-02-17 20:58:27

mavleop
Member
Registered: 2023-02-17
Posts: 2

Cannot get meta key to work with emacs

I'm using X11 + i3 and have mapped caps lock to Hyper_L and added it to mod4. Here is my ~/.xmodmap:

clear Lock
keycode 66 = Hyper_L
add mod4 = Hyper_L

and here is the output of "xmodmap -pm":

xmodmap:  up to 5 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_R (0x69)
mod1        Meta_L (0x40),  Alt_R (0x6c),  Alt_L (0xcc),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3        ISO_Level5_Shift (0xcb)
mod4        Hyper_L (0x42),  Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c)

The problem is that when I try to use the meta key in emacs, it complains that "ø" is not a command.

I'm not sure if this is an emacs or an X11 issue because the alt key (which I normally use for jumping between/deleting words) inserts the special characters into the terminal.

I thought I read that emacs uses mod1 for its meta key but it seems like X11 is hijacking it? Any info is appreciated as this stuff is pretty new to me. Thanks.

Offline

#2 2023-02-17 21:25:19

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

Re: Cannot get meta key to work with emacs

Skip xmodmap and try

setxkbmap -option caps:hyper

instead.

it complains that "ø" is not a command

Do you use a scandinavian layout?

Offline

#3 2023-02-18 22:37:04

mavleop
Member
Registered: 2023-02-17
Posts: 2

Re: Cannot get meta key to work with emacs

Why would mapping caps to hyper fix the meta key? My xmodmap already works for that.

Also I'm using a US layout.

Offline

#4 2023-02-18 22:40:17

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

Re: Cannot get meta key to work with emacs

The plan is to not muck around w/ the modifiers via xmodmap but rely on xkb.
Afaiu the meta key otherwise works as expected?

Offline

Board footer

Powered by FluxBB