Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Remapping Caps Lock to "menu"
Remapping Caps Lock to "menu"
I've been trying to remap Caps Lock to "menu" key (the one that does the same as the right click of the mouse). I tried various options I found, such as setxkbmap -option "caps:menu", putting "caps:menu" to XKBOPTIONS in /etc/default/keyboard and other, but none worked. I use MATE 1.8.1 on Debian Jessie and keep Caps Lock currently disabled via mate-keyboard-properties. Does anyone know how this could be done?
Re: Remapping Caps Lock to "menu"
Normally, you can extract a keycode by using "xev". This opens a terminal window that displays the keycode for any key that is subsequently hit.
Ths issue your are going to have is that this key Truely Locks/Unlocks. If you Caps Lock and bring up a menu and then make a menu selection, you will should get another menu when you unlock in order to enter lower case characters.
I would recommend a key combination. Also, by default, the lefthand "Windows" key, between CTL and ALT is the default Menu key for many desktops and Firefox. It is typically the Super_L key. I switched my menu in OpenBox from [Super_L] to [CTL + ALt + m] to avoid a conflict when the browser was open.
See this howto for examples to bind keys in Mate.
Code: Select all
Caps Lock. On my system"KeyPress event, serial 48, synthetic NO, window 0x2800001,
root 0x4a2, subw 0x0, time 40431001, (445,-328), root:(447,130),
state 0x0, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 48, synthetic NO, window 0x2800001,
root 0x4a2, subw 0x0, time 40431101, (445,-328), root:(447,130),
state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 48, synthetic NO, window 0x2800001,
root 0x4a2, subw 0x0, time 40444864, (0,-172), root:(2,286),
state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 48, synthetic NO, window 0x2800001,
root 0x4a2, subw 0x0, time 40444956, (0,-172), root:(2,286),
state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
I would recommend a key combination. Also, by default, the lefthand "Windows" key, between CTL and ALT is the default Menu key for many desktops and Firefox. It is typically the Super_L key. I switched my menu in OpenBox from [Super_L] to [CTL + ALt + m] to avoid a conflict when the browser was open.
Code: Select all
KeyRelease event, serial 48, synthetic NO, window 0x2600001,
root 0x4a2, subw 0x0, time 40931246, (1064,350), root:(1066,415),
state 0x40, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Last edited by shep on 2017-08-16 01:37, edited 3 times in total.
Re: Remapping Caps Lock to "menu"
Why not just right click the mouse?
The CapsLock button is a real pain in the neck to me because fat-fingering a keyboard means having to undo a lot of capitals. I reprogrammed mine to do nothing; it's dead. I put the following into ~/.config/openbox/autostart.sh
Look up setxkbmap and xkbcomp. You may have to write a little script.
The CapsLock button is a real pain in the neck to me because fat-fingering a keyboard means having to undo a lot of capitals. I reprogrammed mine to do nothing; it's dead. I put the following into ~/.config/openbox/autostart.sh
Code: Select all
setxkbmap -option caps:none
Look up setxkbmap and xkbcomp. You may have to write a little script.
Last edited by Bulkley on 2017-08-16 15:43, edited 1 time in total.
Re: Remapping Caps Lock to "menu"
I already use the WIndows key for some options (such as Win+L to lock the screen, Win+E to invoke the file browser etc). As to why not right-click the mouse: 1) When I am using only the keyboard, having to touch the mouse for one single operation is inconvenient; 2) my keyboard doesn't have the Menu key but has the useless Caps Lock key, and giving it this functionality seems like the most obvious choice; and 3) on my previous Linux system that I used before Jessie, Ubuntu 10.04 Lucid Lynx, I did this and it worked, I just don't remember how I did it.
Re: Remapping Caps Lock to "menu"
i don't know how to do it, but i do know that it has been done.
please have a look.
please have a look.
Re: Remapping Caps Lock to "menu"
In a terminal if I want to bring up my Openbox menu I have to enter obmenu. kriukov is using Mate which must have a similar instruction. What he needs is for the CapsLock button to run an instruction which brings up the Mate menu. It's an intriguing problem.
Re: Remapping Caps Lock to "menu"
kriukov, look at /usr/share/X11/xkb/rules/base.lst. If you scroll down you should find It seems to me that you should be able to do something like
Code: Select all
caps:menu Make Caps Lock an additional Menu key
Code: Select all
setxkbmap -option caps:menu
Re: Remapping Caps Lock to "menu"
The original post stated that he was using Mate 1.8.1 and I gave a link about mapping keys to menus specifically for Mate at the end of an earlier post. My post may have been too lengthy. I'm getting the sense that anything exceeding a 140 character attention span is a waste of bandwidth.
-
- Posts: 198
- Joined: 2008-12-10 20:12
Re: Remapping Caps Lock to "menu"
I did it in /etc/default/keyboard.
Works fine for xfce4.
Code: Select all
XKBOPTIONS="caps:menu"
Debian 12 / Xfce4
Re: Remapping Caps Lock to "menu"
Thanks to all. In /usr/share/X11/xkb/rules/base.lst, there was no caps:menu, and when I added it, nothing happened (I thought it would appear as an option in mate-keyboard-properties, but no. I tried to follow this page to modify .Xmodmap, but this didn't work either. From the same file and xev I found out that it is key 66 and its name is not Caps_Lock, but Mode_switch (lowercase "s"). The only case when it finally worked is when I removed "Mode_switch" and put "Menu" there, and executed xmodmap ~/.Xmodmap (which I then tried to put to .xinitrc (crashed X), to .bash_profile (did nothing) and, finally, to "Startup Applications" (mate-session-properties), which worked after logout/restart). So I think it works now.
-
- Posts: 198
- Joined: 2008-12-10 20:12
Re: Remapping Caps Lock to "menu"
Did you look at: https://wiki.debian.org/Keyboard ?
Debian 12 / Xfce4
Re: Remapping Caps Lock to "menu"
holy crap, that actually works!Bulkley wrote:It seems to me that you should be able to do something likeCode: Select all
setxkbmap -option caps:menu
now how do i get rid of it...
Re: Remapping Caps Lock to "menu"
Hmmm, it seems that at times there are distinct advantages, using a resource-intensive DE ...
Keyboard Mapping Options / KDE 5.8.6
Options for the CapsLock Key
Of course it's more manly to use the command line, I realise that .....
Cheers,
Gaius
Keyboard Mapping Options / KDE 5.8.6
Options for the CapsLock Key
Of course it's more manly to use the command line, I realise that .....
Cheers,
Gaius
If you can’t explain it simply, you don’t understand it well enough.
Albert Einstein
Albert Einstein