Saturday, April 20, 2024
 Popular · Latest · Hot · Upcoming
-4
rated 0 times [  -4] [ 0]  / answers: 1 / hits: 30126  / 1 Year ago, thu, december 1, 2022, 10:46:32

I know how to use xmodmap to remap the Caps lock key so it acts as a Control key, or as an Escape key. I would like to combine both features as follows:



When I push, then release, the Caps lock key, it sends Escape.
When I hold down Caps lock and push another key (say A), it send Control-A.



Is there some combination of xkb, xmodmap and something else that could make Caps lock behave this way in X?



I'm using Ubuntu Precise on a Macbook Air 3,1.


More From » keyboard

 Answers
3

You can do the first (mapping Caps Lock to Esc) but you cannot do the second.



Simple Explanation: Caps Lock is just not designed to do something when pressed.



Elaborate Explanation:
There are many types of keys. Two of them are Modifier Keys and Lock Keys.



Caps Lock is a Lock Key while keys such as Ctrl, Alt, and Shift are Modifier Keys.



It's apparent from their names that Modifier Keys modify the function of the next key(s) pressed, and Lock Keys act as a toggle switch to turn on or off some particular function.



Now, since Caps Lock is a Lock Key, you cannot have it behave like a Modifier Key without mapping it to one. Caps Lock by itself cannot function as a Modifier Key.


[#36071] Saturday, December 3, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainbby

Total Points: 184
Total Questions: 115
Total Answers: 112

Location: Colombia
Member since Thu, Sep 29, 2022
2 Years ago
ainbby questions
Thu, Mar 23, 23, 10:26, 1 Year ago
Wed, May 10, 23, 00:10, 1 Year ago
Fri, Apr 15, 22, 10:11, 2 Years ago
;