CapsLockãCtrlã«ããã¾ã¨ã
ã©ããCapsLockãªãã¦ççºããã°ããã¨æãAlisueã§ãã
é常ã®ãã¼ãã¼ãã§ã¯Aã®æ¨ªã¨ããé常ã«æ¼ãããä½ç½®ã«CapsLockã¨ããå ¨ã使ç¨ããªããã¼ãé ç½®ããã¦ãã¾ãã é常ã«ãã£ãããªãã®ã§ãã®ãã¼ãCtrlã¨ãã¦ä½¿ç¨ãããã¨ãå¤ãã®ã§ãããæ¹æ³ãããããããããä¸åº¦ã¾ã¨ãã¦ããã¾ãã ãªãæ¬è¨äºã¯EmacsWiki: Moving The Ctrl Keyã®ç¼ãå¢ãã®ãããªãã®ãªã®ã§ãã詳ããç¥ãããæ¹ã¯åæãåç §ãã¦ãã ããã
Gnome ã®è¨å®ã使ç¨ããæ¹æ³ï¼ãã¦ã¹ã§è¨å®å¯è½ï¼
ãã¹ã¯ããããã½ã³ã³ã¨ãã¦ä½¿ç¨ããå ´åã¯GUIã«ã¦è¨å®ãããã¨ãå¯è½ã§ãã 以ä¸ã§ã¯Debian Wheezyï¼Gnome3ï¼ã«ã¦è¡ãæ¹æ³ãè¨è¼ãã¾ãã
ã·ã¹ãã è¨å® > ãã¼ãã¼ããéã
ã¿ã¤ãã³ã°æ¬ä¸é¨ã«ãããã¬ã¤ã¢ã¦ãã®è¨å®ããéã
ã¬ã¤ã¢ã¦ãæ¬ä¸é¨ã«ããããªãã·ã§ã³(O)...ããéã
Ctrl ãã¼ã®ä½ç½®ãã¯ãªãã¯ããCaps Lock ã Ctrl ã¨ãã¦æ±ããã«ãã§ãã¯ãå ¥ãã
å®éã®è¨å®ã¯dconfãã確èªãããã¨ãã§ã
org.gnome.libgnomekbd.keyboard
ã®options
ã¨ããé
ç®ã«['ctrl\tctrl:nocaps']
ã¨ããå¤ã追å ããã¾ãã
ãããã£ã¦ä¸è¨ã®ããã«ã¿ã¼ããã«ã§ç´æ¥ãã®å¤ãæå®ãããã¨ãå¯è½ã§ãã
# CapsLockãCtrlã«å¤æ´
% gsettings set org.gnome.libgnomekbd.keyboard options "['ctrl\tctrl:nocaps']"
# CapsLockã¨Ctrlãå
¥ãæ¿ãã
% gsettings set org.gnome.libgnomekbd.keyboard options "['ctrl\tctrl:swapcaps']"
# CapsLockãå
ã«æ»ã
% gsettings set org.gnome.libgnomekbd.keyboard options "[]"
X Window System ã®è¨å®ã使ç¨ããæ¹æ³
å ã»ã©ã®æ¹æ³ã¯Gnomeãªã©ã使ç¨ãã¦ããªãã¨ä½¿ãã¾ãããããã®æ¹æ³ãªãã°åççã«ã¯ X Window Systemãå©ç¨ãã¦ãããã¹ã¦ã®Linuxã§ä½¿ç¨å¯è½ã§ãã
xkb ã使ç¨ãã¦å¤æ´ããæ¹æ³
xkbã«ã¯ãªãã·ã§ã³ãããã¤ãããããã®ä¸ã§CapsLockãCtrlã«ãããªãã·ã§ã³ãCapsLockã¨Ctrlãå ¥ãæ¿ãããªãã·ã§ã³ãããã¾ãã ãããèµ·åæã«ãã¦ããã¦ããã°CapsLockãCtrlã«ãããã¨ãå¯è½ã§ãã
setxkbmap ã使ç¨ãã¦ãã¼ãã¼ããªãã·ã§ã³ãæå®ããæ¹æ³
ã¿ã¼ããã«ã«ã¦setxkbmap
ãå¼ã³åºããã¨ã«ãããã¼ãã¼ããªãã·ã§ã³ãç´æ¥å¤æ´ãããã¨ãå¯è½ã§ãã
以ä¸ä¾ãåç
§ãã¦ãã ããã
# CapsLockãCtrlã«å¤æ´
% setxkbmap -option ctrl:nocaps
# CapsLockã¨Ctrlãå
¥ãæ¿ãã
% setxkbmap -option ctrl:swapcaps
# CapsLockãå
ã«æ»ã
% setxkbmap -option
ãªãã·ã§ã³ã®å
容ããæ¨æ¸¬ããã«Gnomeã¬ãã«ã§ã®è¨å®ã¯ãã®ãã¼ãã¼ããªãã·ã§ã³ãå¤æ´ãã¦ããããã§ãã
ãã ãGnomeã¬ãã«ã§ã®è¨å®ã¨éãsetxkbmap
ã§è¨å®ãè¡ã£ãå ´åã¯ãã°ã¤ã³ä¸ããå¤æ´ãåæ ããã¾ããã
ãããã£ã¦ä¸è¨ã³ãã³ãã®ä¸ããå¿
è¦ãªãã®ã~/.profile
ã/etc/profile
ã«å ãèªåçã«å¼ã³åºãããã«ãã¦ãã ããã
ãªãFedora 15ã®å ´å~/.Xkbmap
ã¨ãããã¡ã¤ã«ãããã¨èªåçã«å
容ãsetxkbmap
ã®å¼æ°ã¨ãã¦ä½¿ç¨ããããã§ãã
ãããã£ã¦ãã®ãã¡ã¤ã«ãä½æããªãã·ã§ã³ã®é¨åã®ã¿è¨è¼ããã°è¯ããã¨ã«ãªãã¾ãã
X configuration file (/etc/X11/xorg.conf
ãªã©ï¼ã§æå®ããæ¹æ³
Xã®ãªãã·ã§ã³ãªã®ã§Xã®è¨å®ãã¡ã¤ã«ã«ã¦æå®ãããã¨ãå¯è½ã§ãã
/etc/X11/xorg.conf
ã/etc/X11/xorg.conf.d/10-capslock.conf
ãªã©Xã®è¨å®ãã¡ã¤ã«ã«ä¸è¨ã®ããã«è¨è¼ãã¦ãã ããã
Section "InputDevice"
Driver "keyboard"
Option "XkbOptions" "ctrl:nocaps" # CapsLockãCtrlã«å¤æ´
Option "XkbOptions" "ctrl:swapcaps" # CapsLockã¨Ctrlãå
¥ãæ¿ãã
EndSection
ãªããããã®è¨å®ããã¾ãè¡ããªãå ´åã¯ä¸è¨ã®è¨å®ã試ãã¦ã¿ã¦ãã ããã æè¿ã®Xorgã¯ãã¡ãã®è¨å®æ¹æ³ãæ¨å¥¨ãã¦ããããã§ãã
Section "InputClass"
Identifier "Keyboard Setting"
MatchIsKeyboard "yes"
Option "XkbOptions" "ctrl:nocaps" # CapsLockãCtrlã«å¤æ´
Option "XkbOptions" "ctrl:swapcaps" # CapsLockã¨Ctrlãå
¥ãæ¿ãã
EndSection
xmodmap ã使ç¨ãã¦åå²å½ã¦ãè¡ãæ¹æ³
xmodmap
ã¯Xã«ããã¦ãã¼ãã¼ããããã³ã°ãä¿®æ£ããããã«ç¨ããã½ããã¦ã§ã¢ã§ãã
ãããã£ã¦ä»åã®ã±ã¼ã¹ã®ããã«CapsLockãCtrlã«å¤æ´ããå ´åã«ä½¿ãã¾ãã
é常xmodmap
ã®è¨å®ãã¡ã¤ã«ã¯~/.xmodmap
ã¨ããååã§ä¿åã/.xsession
å
ããä¸è¨ã®ããã«å¼ã³åºãã¾ãã
xmodmap ~/.xmodmap
ãã ~/.xsession
ã¯é常åå¨ãã¦ããªãã®ã§æ°è¦ä½æãããã¨ã«ãªãã¨æãã¾ãã
ãã®æå®è¡æ¨©éãå¿ããã«ä¸ãã¦ããã¦ãã ããï¼% chmod +x ~/.xsession
ï¼ã
~/.xsession
ãã¡ã¤ã«ã®å½¹å²ã«é¢ãã¦ã¯è±èªã§ãã
What is â.xsessionâ for?
ã®åçãããããããã¾ã¨ã¾ã£ã¦ããã¨æãã¾ãã
ä¸è¨ã®ããã«~/.xsession
ãã~/.xmodmap
ãå¼ã³åºãããã«è¨è¼å¾ã«~/.xmodmap
ã«ä¸è¨ã®ã©ã¡ãããè¨è¼ãã¦ãã ããã
!
! CapsLockãCtrlã«å¤æ´
!
remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
add Control = Control_L
!
! CapsLockã¨Ctrlãå
¥ãæ¿ãã
!
remove Lock = Caps_Lock
remove Control = Control_L
keysym Caps_Lock = Control_L
keysym Control_L = Caps_Lock
add Lock = Caps_Lock
add Control = Control_L
Xã®å¤ã§ãè¨å®ããå ´åï¼ãµã¼ãã¼ãVirtual Consoleãªã©ï¼
å ã»ã©ã®æ¹æ³ã¯Xã®æ©è½ãç¨ãã¦å¤æ´ãè¡ãªã£ã¦ããããXã®å¤ã§ã¯å¤æ´ãé©ç¨ããã¾ããã ãµã¼ãã¼ãVirtual Consoleã§ãCapsLockã¯éªéè ã§ããç¡ãããåã¯ãã®ã¬ãã«ã§ã®è¨å®ãè¡ãªã£ã¦ãã¾ãã
dumpkeys
ã¨loadkeys
ã使ç¨ããæ¹æ³
ããããã©ã®OSã§ã使ç¨åºæ¥ãã§ãããä¸è¬çãªæ¹æ³ã§ãã
ã¾ãdumpkeys
ã³ãã³ãã使ç¨ãã¦ç¾å¨ã®ãã¼ãããããã¡ã¤ã«ã«åãåºãã¾ãã
次ã«ãã¼ããããä¿®æ£ãæå¾ã«loadkeys
ã§é©ç¨ãã¾ãã
ãªãä¸è¨ã§ä¿åãããã¼ããããã¡ã¤ã«ã¯/usr/share/keymaps
ã«ä¿åããã®ã§åå¨ããªãå ´åã¯ä¸è¨ã³ãã³ãã§ä½æãã¦ãã ããã
% sudo mkdir -p /usr/share/keymaps
å¤æ´é¨åã®ã¿ã追å ã§èªã¿è¾¼ã¾ãããã¿ã¼ã³
å¤æ´é¨åã®ã¿ã追å ã§èªã¿è¾¼ã¾ãããã¿ã¼ã³ã§ããã¾ãä¸è¨ã³ãã³ããå®è¡ãã¦ãã¼ããããã¡ã¤ã«ã®ã²ãªå½¢ãä½æãã¦ãã ããã
% sudo dumpkeys | head -1 | sudo tee /usr/share/keymaps/Caps2Ctrl.map
次ã«ã好ããªã¨ãã£ã¿ï¼Vimçï¼ã§ä½æããéå½¢ã«ä¸è¨ãå ãã¦ãã ããã
keycode 58 = Control # CapsLock act as Ctrl
# keycode 29 = Caps_Lock # Ctrl act as CapsLock
# alt_is_meta # Fix the Alt key"
æå¾ã«loadkeys
ã§å¤æ´ãèªã¿è¾¼ã¾ãã¾ãã
% sudo loadkeys /usr/share/keymaps/Caps2Ctrl.map
ããã§ãã°ã¤ã³ä¸ã®ã¿ä¸æçã«ãã¼ããããå¤æ´ãããã¨ãã§ãã¾ãããªãæ常çã«å¤æ´ãããå ´åã¯/etc/rc.local
çã«ä¸è¨ã³ãã³ããï¼sudoãåãé¤ãã¦ï¼è¨è¼ãã¦ãã ããã
å®å ¨ã«ãã¼ããããç½®ãæãããã¿ã¼ã³
ãã¹ã¦ã®ãã¼ããããæ°ãããã¼ãããã§ç½®ãæãããã¿ã¼ã³ã§ããé常åè¨ããå¤æ´é¨åã®ã¿ãç½®ãæãããã¿ã¼ã³ã§äºè¶³ããã¨æãã¾ãã念ã®çºã ã¾ãä¸è¨ã³ãã³ããå®è¡ãã¦ç¾å¨ã®å®å ¨ãªãã¼ãããã®ã³ãã¼ãä½æãã¦ãã ããã
% sudo dumpkeys | sudo tee /usr/share/keymaps/Caps2Ctrl-Full.map
次ã«ä½æããå®å
¨ãªãã¼ãããã®ã³ãã¼ä¸ã®å¿
è¦ç®æãåè¨ãåèã«ä¿®æ£ãã¦ãã ããã
æå¾ã«loadkeys
ã§å¤æ´ç®æãèªã¿ãã¾ããé¨åã¯åæ§ã§ãã
ãã®å®å
¨ã«ç½®ãæããæ¹æ³ã¯sed
ã¨çµã¿åãããã¨é常ã«ä¾¿å©ã§ããä¸è¨ã®ããã«ã¯ã³ã©ã¤ãã¼ã§ç½®ãæãããã¨ãå¯è½ã«ãªãã¾ãã
ãã CapsLockã«å²ãå½ã¦ããã¦ãããã®ãCapsLockã§ã¯ãªãCtrlL_Lockã®å ´åãããããã¾ãä¸è¨ã³ãã³ããå®è¡ãã¦ã©ã¡ããå²ãå½ã¦ããã¦ããã®ãã確èªãã¦ãã ããã
% sudo dumpkeys | egrep "keycode\s*58"
次ã«ä¸è¨ã³ãã³ããå®è¡ãã¦å®éã®æ¸ãæããè¡ãªã£ã¦ãã ããããªãCtrlL_Lockãå²ãå½ã¦ããã¦ããå ´åã¯Caps_Lockã®é¨åãCtrlL_Lockã¨èªã¿æ¿ãã¦å®è¡ãã¦ãã ããã
% sudo dumpkeys | sed 's/58\s*=\s*Caps_Lock/58 = Control/' | sudo loadkeys
# CtrlãCapsLockã¨ãã¦ä½¿ç¨ãããå ´åã¯ä¸è¨ã³ãã³ããå®è¡
% sudo dumpkeys | sed 's/29\s*=\s*Control/29 = Caps_Lock/' | sudo loadkeys
ããã§ãã°ã¤ã³ä¸ã®ã¿ä¸æçã«ãã¼ããããå¤æ´ãããã¨ãã§ãã¾ãããªãæ常çã«å¤æ´ãããå ´åã¯/etc/rc.local
çã«ä¸è¨ã³ãã³ããï¼sudoãåãé¤ãã¦ï¼è¨è¼ãã¦ãã ããã
console-setup
ãå©ç¨ããæ¹æ³
æ¯è¼çæ°ããDebianã§ã¯/etc/default/keyboard
ã¨ãããã¡ã¤ã«ãåå¨ãã¦ããXKBOPTIONS
ãæ¸ãæãããã¨ã§CapsLockãCtrlã«å¤æ´ãããã¨ãã§ãã¾ãã
ååãXãªã®ãæ°ã«ãªãã¾ããâ¦â¦ã/etc/default/keyboard
ãã¨ãã£ã¿ã§éãä¸è¨ã®ããã«ä¿®æ£ãã¦ãã ããã
# XKBOPTIONS=""
XKBOPTIONS="ctrl:nocaps" # CapsLock --> Ctrl
# XKBOPTIONS="ctrl:swapcaps" # CapsLock <-> Ctrl
ä¿®æ£å¾ã«ä¸è¨ã³ãã³ããå®è¡ãã¦å¤æ´ãé©ç¨ãã¦ãã ããã
% sudo dpkg-reconfigure -phigh console-setup
console-tools
ãå©ç¨ããæ¹æ³
å¤ãDebianç³»OSã§ã¯/etc/console-tools/remap
ã¨ãããã¡ã¤ã«ãåå¨ãã¦ããèªåçã«dumpkeys
ã¨loadkeys
ã®éã«å¼ã³åºãããsed
ã¹ã¯ãªããã¨ãã¦å®è¡ããã¾ãã
ãããã£ã¦å
ç¨dumpkeys
, sed
, loadkeys
ãå©ç¨ããã¯ã³ã©ã¤ãã¼ã¨åæ§ã«ç½®ãæããè¡ãªã£ã¦ãã ããï¼ä¸è¨åç
§ï¼ã
# This turns caps lock into control
s/58\s*=\s*Caps_Lock/58 = Control/;
# CtrlãCapsLockã¨ãã¦ä½¿ç¨ãããå ´åã¯ä¸è¨ã³ãã³ããå®è¡
s/29\s*=\s*Control/29 = Caps_Lock/;
ä¿®æ£å¾ã«ä¸è¨ã³ãã³ããå®è¡ãã¦å¤æ´ãé©ç¨ãã¦ãã ããã
% sudo invoke-rc.d console-screen.sh restart