0

I'm talking about the Menu (keycode = 135) (aka Right Click), I don't use it

So I disabled its contextmenu action with Xmodmap tool, now it doesn't open the menu and still working for keyboard shortcuts*

Also disabled repeating itself with xset -r 135 (Because keys like Ctrl don't repeat themselves while they are pressed)

* But the problem is that I can't combine it with other keys, like how Ctrl, Shift and Alt does.

For example I can create a shortcut like Shift+Alt+S, but I can't do something like that with Menu+somekey, it doesn't bind with other keys. I'm able to create "chords" of keys but it's not what I'm searching for.

Looks like I can't do it with Xmodmap :/

If you run xev -event keyboard you can see that what changes with keys like Ctrl, Shift and Alt is the state value, it goes from state 0x0 when pressed, to state 0x4 (In the case of Ctrl L) when released. That doesn't happen with Menu key and other non-bindable keys, all of them stays in state 0x0, maybe this is the problem?

How I can solve this?

Thanks

1 Answer 1

-1

You misunderstand the Modifiers keys.

You can see what are your modifiers with xmodmap.

Menu is not a modifier by default, despite the fact it can trigger some contextual menus like F10 (depending on the software you use).

When you see state 0x0 in the output of xev, it is effictively related to the modifier, press multiple modifiers at the same time and you will see it sum up.

Effictively xmodmap will not allow you to create what you want. Now, you can effictively try to add Menu to your modifier map with a valid modifier name, and modify your xkb map to ensure it will still send a keysym ... but it is not a elegant thing to do.

Let me suggest instead to use a software named xcape (there are others compatible with Wayland) to emulate a modifier Hyper_R (for example, and assumming you add it to your mod map) on this key when pressed in combinaison with others keys, and Menu when pressed alone.

The documentation of xcape is really staightforward to accomplish such modification.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .