How to change capslock and other keymapping in deepin linux
Tofloor
poster avatar
guoqiao
deepin
2017-07-28 16:46
Author
本帖最后由 guoqiao 于 2017-7-28 09:01 编辑

0. Background

I am new to Deepin Linux, and I am a Vim user. The capslock key annoys me, I just learned how to re-map it in the Deepin way.


1. To change mapping of Caps Lock, do this fist:

  1. gsettings set com.deepin.dde.keybinding.mediakey capslock '[]'
Copy the Code


2. Then, you can re-map capslock with prefered layout-options.

Swap Caps Lock and Esc:

  1. gsettings set com.deepin.dde.keyboard layout-options '["caps:swapescape"]'
Copy the Code


Map Caps Lock to Esc:

  1. gsettings set com.deepin.dde.keyboard layout-options '["caps:escape"]'
Copy the Code


Disable Caps Lock:

  1. gsettings set com.deepin.dde.keyboard layout-options '["caps:none"]'
Copy the Code


It works immediately on my Thinkpad X1 Carbon, without logout or restart.If you want to learn more about this topic, keep reading.

3. Get all layout-options:

  1. localectl list-x11-keymap-options
Copy the Code


4. Get all layout-options for capslock only:

  1. localectl list-x11-keymap-options | grep caps:
Copy the Code


List:


  1. caps:backspace
  2. caps:capslock
  3. caps:ctrl_modifier
  4. caps:escape
  5. caps:hyper
  6. caps:internal
  7. caps:internal_nocancel
  8. caps:menu
  9. caps:none
  10. caps:numlock
  11. caps:shift
  12. caps:shift_nocancel
  13. caps:shiftlock
  14. caps:super
  15. caps:swapescape
Copy the Code


5. If you mess up, reset each KEY to default:


  1. gsettings reset com.deepin.dde.keybinding.mediakey capslock
  2. gsettings reset com.deepin.dde.keyboard layout-options
Copy the Code


Or reset each SCHEMA:


  1. gsettings reset-recursively com.deepin.dde.keybinding.mediakey
  2. gsettings reset-recursively com.deepin.dde.keyboard
Copy the Code

Reply Favorite View the author
All Replies
avatar
deepinwang
deepin
2017-07-28 18:36
#1
Added to Deepin Wiki: https://wiki.deepin.org/index.php?title=Modify_keyboard_mapping&language=en .
Thanks for your contribution!
Reply View the author
avatar
samwang1027
deepin
2018-03-16 01:34
#2
Thank you so much!!
Reply View the author
avatar
shayaknyc
deepin
2019-03-01 10:45
#3
Edited by shayaknyc at 2019-3-1 02:50

Is there a gui for this?
For clarification: I'm new to Deepin linux as well, and I'm using a Mac keyboard. Currently the keyboard layout is set up as follows:
On the left side I have:
Control | alt/option | cmd | space_bar

Currently, alt/option behaves like "alt" and "cmd" behaves similarly to the Windows Start Key button. I'd actually like to flip the bindings so that the "cmd" key executes "alt" and that "alt/option" key executes the "start" - what's that key called? Is it super? Trying to follow the instructions here, and I'm not sure how to go about swapping these keys.

Also, on the right side I have:
space_bar | cmd | alt/option | control

Is there any way to make the right-side alt/option button behave like the windows menu/right-click?

Thanks in advance for your help on this.... A gui for this would make things FAR easier.... or, if someone could tell me how to identify what the keymapping is when I press on the key so I know how to swap, that would be helpful.

Thank you!
Reply View the author