You are not logged in.

#1 2024-04-10 08:31:18

icelord
Member
Registered: 2024-04-10
Posts: 31

Xmodmap, Am I missing something?

So I set my Xmodmap.conf according to the Archwiki recommended  LQwiki.
I am using i3wm and I have alacritty installed.

After two nights of searching I caved in and have come to ask for help.

I am trying to set my multimedia keys which do not work, a printout has said that they were not assigned, so I assigned the XF86... for volume mute, sound up as well as volume down.
Since the changes my left and right arrow keys do not work and the sound keys still do not work either.
I am still a noob, are there any places there could be conflicting keybindings? I have checked all my .config files, and I have commented out the pulse audio within my alacritty config.

Offline

#2 2024-04-10 13:08:45

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

Re: Xmodmap, Am I missing something?

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855

Post your .Xmodmap ("Xmodmap.conf"??) and the output of

xev -event keyboard

when pressing an arrow and the mute key.

Offline

#3 2024-04-10 19:34:13

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

Here is the xev of the mute button:

KeyPress event, serial 25, synthetic NO, window 0x2400001,
    root 0x31d, subw 0x0, time 19941573, (-99,168), root:(588,186),
    state 0x0, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
    XKeysymToKeycode returns keycode: 113
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2400001,
    root 0x31d, subw 0x0, time 19941647, (-99,168), root:(588,186),
    state 0x0, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
    XKeysymToKeycode returns keycode: 113
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  29  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

And here is the xmodmap.conf:

keycode 113 = XF86AudioMute
keycode 114 = XF86AudioLowerVolume
keycode 115 = XF86AudioRaiseVolume

Offline

#4 2024-04-10 19:36:56

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

Re: Xmodmap, Am I missing something?

Please use [code][/code] tags, not "quote" tags. Edit your post in this regard.

The keycode is properly mapped, but not grabbed by anything (as shortcut)
If you expect eg. your desktop shell to grab the key, nb. that you'll have to  finish xmodmap before that starts or it might grab the wrong code.

Offline

#5 2024-04-10 20:43:09

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

Okay thank you I shall remember that for next time.

So what you are telling me is I need to set each key with xmodmap or else it would cause an error?

Offline

#6 2024-04-10 20:45:43

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

Re: Xmodmap, Am I missing something?

So what you are telling me is I need to set each key with xmodmap or else it would cause an error?

What? No.
You need to run "xmodmap ~/.Xmodmap" before whatever is supposed to grab the shortcut (eg xbindkeys) tries to grab the shortcut, otherwise the symbol will not be (properly) resolved.
The modmap itself clearly works, but you'r enot assigning XF86AudioMute to any global shortcut right now.

Offline

#7 2024-04-10 20:59:01

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

But that's the thing, I have done this already.

That's why I asked where any conflicts could be.

Offline

#8 2024-04-10 21:00:26

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

Re: Xmodmap, Am I missing something?

Done what?
You're NOT binding that code to any global shortcut, but what do you think you've done *excatly*?

Offline

#9 2024-04-10 21:06:44

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

I did bind audio mute to key code 113?

Is there more that has to be done?

Offline

#10 2024-04-10 21:20:59

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

Re: Xmodmap, Am I missing something?

You'll still have to bind it to some actual action.

Offline

#11 2024-04-10 21:22:56

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

Please can you explain this one a bit more, or send me a link to the wiki.

It's hard finding information, the page that guided me through the xmodkey setup didn't mention anything else.

Offline

#12 2024-04-10 21:25:29

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

Re: Xmodmap, Am I missing something?

This has nothing to do w/ xmodmap, what is your desktop environment?

Offline

#13 2024-04-10 21:27:34

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

It's still basically a fresh install, all I have is i3, alacritty and firefox.

Offline

#14 2024-04-10 21:52:29

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

Re: Xmodmap, Am I missing something?

https://i3wm.org/docs/userguide.html#keybindings
And then you bind that to some alsactl or pactl command

Offline

#15 2024-04-10 21:56:28

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

Thank you I appreciate the help, I will check it out.

Offline

#16 2024-04-10 22:00:25

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

Do I have to bind the keys through i3 as well? I had the idea that xmodmap was like a 'one ring to rule them all' of some sort?

Offline

#17 2024-04-10 22:04:45

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

Re: Xmodmap, Am I missing something?

xmodmap links keycodes to key symbols and is typically not even necessary - 113 should be XF86AudioMute anyway.
It is not a shortcut daemon, those are provided by the WMs or desktop environments or dedicated like eg. xbindkeys/sxhkd

Offline

#18 2024-04-10 22:09:18

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

Oh I thought I was mapping keycodes to 'short cuts', this makes more sense now.

BTW, where did you see that the key was not being grabbed?

Offline

#19 2024-04-10 22:11:01

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

Re: Xmodmap, Am I missing something?

grabbed key do not show up as key events in xev, you just get a keymapnotify event.

Offline

#20 2024-04-10 22:14:58

icelord
Member
Registered: 2024-04-10
Posts: 31

Re: Xmodmap, Am I missing something?

Okay, That is good to know thanks.

Offline

Board footer

Powered by FluxBB