Keyboard layout switching/ko

키보드 배치는 키보드의 스캔코드를 프로그램에 보낼 문자에 대응합니다. 키보드 배치는 또한 키 자체의 문자를 출력하지 않지만 다음 키 입력의 출력을 수정하는 복잡한 전달 과정을 수행할 수도 있으며 이를 데드키라고 합니다. QWERTY 키보드가 ASCII 집합 외부에 있는 문자를 입력할 수 있는 것처럼 비 QWERTY 키보드를 지원하려면 적당한 키보드 배치 설정이 필요합니다.

OpenRC
문서로 설명이 잘 되어 있지만 상당히 이해하기 힘든  파일을 편집하십시오. 이 파일에는 keymap 변수의 값 에 나타나는 적당한 키보드 배치를 설정해야 하며 추가로 extended_keymaps 변수의 값  디렉터리와 같은 적당한 포함 디렉터리 경로에서 추가적으로 파일을 설정할 수 있음을 보여줍니다.

마지막으로 부팅 실행 레벨에 를 추가하십시오.

개별 키보드 배치
개별 키 배치를 만들려면 의 제공 키 배치를 살펴보십시오:

여기에 제시한 예제는 U.S. QWERTY 키 배치에서 정방향 슬래시와 어퍼스트로피 키를 서로 바꾼 점만 제외하고 모든 면이 동일한 개별 키 배치입니다:

키에 할당한 키 코드를 찾으려면 출력 내용을 보십시오:

위 명령으로 키를 찾지 못했다면 다음 명령을 실행하십시오:

그냥 키를 누르면 키 코드가 나타납니다. 과정이 끝났다면 몇 초 기다리시면 프로그램이 닫힙니다.

systemd
systemd uses and includes both terminal font and keyboard layout settings but lacks advanced settings found in OpenRC. Valid values should match what OpenRC supports for the corresponding variable.

X11
최신 X11 프로그램은 보통 libXklavier를 사용하며("klavier"는 "키보드"의미를 지닌 독일어) 으로 설정할 수 있습니다. 게다가 X11에서는 가상 터미널에서 지원하는 키보드 배치보다 더 많은 키보드 배치 셋을 지원합니다. 적당한 데스크톱 환경에서는 자체적으로 자체 키보드 배치를 관리한다는 점을 알아두어야합니다. 앞에서 언급한 프로그램이 직접 활용할 필요는 없어졌지만, 키보드 배치 관리 프로그램에 문제가 있거나 기능이 빠졌을 경우 이를 다루는 일이 간단해질 수 있습니다.

KDE4
을 열고 모듈을 찾아보십시오.

일반 데스크톱 환경
Edit and call  from there or setup the keyboard in Xorg configuration file (see below for examples).

lxpanel의 키보드 배치 처리자
에서는 키보드 배치 처리자를 패널 항목으로 제공합니다.



setxkbmap 활용
These changes are non-permanent and will persist only as long as the user does not restart X11. Naturally the command can be called from a startup script to set the appropriate parameters on every start of the X server.

기존 설정을 요청한 다음:

키보드 배치를 설정하시고:

키보드 배치, 형식, 모델을 설정하십시오:

Finding the supported layouts and variants or values of other xkb properties does not appear to be possible with this application, although most of them are listed in the file. To get the most complete list seems to be possible only by examining other files in. For sake of sanity, it is advised to use of a proper desktop environment with its own keyboard layout management.

시스템 범위 설정 배치 및 단축키 활용
This method is recommended for configurations without desktop environments, in other words just X11 with a window manager. Create the file and configure it with the appropriate keyboard settings.

The example above configures US and Brazilian keyboard layouts with + as shortcut to alternate between them. Brazilian layout is signalled by Scroll Lock LED on the keyboard.

가능한 추가 설정
There are a number of variants and options available which can be used while configuring the keyboard mappings. Most of those can be found in the file.

For example, the US layout with possibility to write some international characters can be configured by using the variant :

is then used as a modifier for typing international characters.

Xorg provides the option to type international and various symbol characters by composition - which means by pressing compose key followed by a sequence of characters. To enable composition add the  option:

The  option above configures  as compose key. With this setting:


 * Press then type 'oo' to get degree sign '°'
 * Press then type 'oc' to get copyright sign '©'
 * Press then type ':)' to get smiling face '☺'
 * Press then type '^2' to get superscript 2 ('²')
 * Press then type '_2' to get subscript 2 ('₂')
 * Press then type 'di' to get diameter sign '⌀'

... and many more. The file lists all possible composition sources.

X 키보드 배치 개선
This is necessary when more far-reaching changes have to be made to the keyboard layout, such as adding key assignments, or adding actions to function keys. Since such changes are actually enhancements to the source files of a package, it is recommended to use the epatch_user mechanism so that these amendments are preserved when the package is next updated.

기본 원리
The relevant Gentoo package is. Configuring a keyboard under X is more complicated than doing the same for a virtual console. The pertinent configuration files can be found in in these subdirectories:


 * These files associate key codes with symbolic names - it is unlikely that anyone wants to change this.
 * These files associate key codes with symbolic names - it is unlikely that anyone wants to change this.


 * This is the physical shape of the keyboard, used by some software for drawing diagrams of it - it is also unlikely that anyone wants to change this.
 * This is the physical shape of the keyboard, used by some software for drawing diagrams of it - it is also unlikely that anyone wants to change this.


 * The files here create "types". Used in a key declaration, a type specifies which combinations of shift keys can be used with the key.
 * The files here create "types". Used in a key declaration, a type specifies which combinations of shift keys can be used with the key.


 * These files specify the actual key assignments.
 * These files specify the actual key assignments.


 * The files here specify "actions" (such as switching to a virtual terminal), giving them names, which can be assigned to keys.
 * The files here specify "actions" (such as switching to a virtual terminal), giving them names, which can be assigned to keys.


 * These files, given parameters such as the keyboard type, and a language, activate the appropriate specifications in the other directories.
 * These files, given parameters such as the keyboard type, and a language, activate the appropriate specifications in the other directories.

A fuller description of the files in these directories can be found at An Unreliable Guide to XKB Configuration by Doug Palmer. It is a lot better than its name suggests. Further documentation can be found at xkeyboard-config's home page at freedesktop.org.

Xkb gives keys names like "" which means "key in the Alphanumeric area, in row C (i.e. third row from the bottom, the row CapsLock is on), and key number 01, the first key at the left of the row". This key is in an English layout. Keys in other areas have other names, such as "" for, or "" for the left control key.

키 할당 추가
As an example, this section will enhance the British English keyboard layout such that typing, , or with  will generate the German umlaut letters ä, ö, and ü. It should also do the Right Thing for the upper case versions. The keys to enhance are (),  () and  (). (The character ß is already assigned to +.)

The names of the umlauted letters in xkb are "adiaeresis" and so on. These names can be found in the file, though the leading "XK_"s have to be removed to get the names.

Identify the right file in the directory. Most of these files are named as two letter country codes (such as for Great Britain) so guess the one which matches the keyboard layout currently selected in X. In this example,  is enhanced.

With the information above, create new entries by copying the existing scheme in. In this example, these entries should be added into the section called "basic". From its content, it is easy to guess that the four items in the braces and brackets within the entry for each key are for regular (without other key combinations),, , and + respectively:

추가 설정을 넣고 나면, 섹션의 내용은 다음과 같습니다:

Having saved this file, restart X Windows. A typical desktop environment, XFCE, re-reads the above configuration files each time it starts. Should there be errors, error messages will be written to the normal - if X Windows is started from the command line,  will be the virtual terminal it was started from.

기능 키에 동작 할당
As an example, add the actions "switch to virtual terminal n" (where n > 12) to the function keys -  when, , and  are all selected. The same effect should also occur when and  are selected.

First, search for the file in the directory which handles the existing assignments for the Function keys. This file is. The entry in this file for, which is intended to be modified, is:

There are two things to note with this entry:
 * It is of type "CTRL+ALT"; it thus takes the standard four shift key settings with and, plus a fifth setting of +. Since the goal is to use ++, and there is no suitable existing type, a new one needs to be created.
 * The "action"  is just a defined symbol in the xkb system. Its semantics are given to it by an entry in a file in the  directory, namely . There is no symbol   (or higher) - instead, steal the otherwise unused existing symbols F13, F14, ..., F24.

새 CTRL+ALT+SHIFT 형식 만들기
Having located "CTRL+ALT" in, it is easy enough to copy it, rename the copy to "CTRL+ALT+SHIFT" and extend this to allow the modifier key combination ++. The result looks like this:

F13, ..., F24 심볼 활성화
The symbol  is swiftly located in. It is a simple matter to copy its form, creating assignments for the symbols F13, ..., F24. The definition for the first of these symbols, F13, in then looks like:

Analogous definitions for F14, ..., F24 should also be put into the file.

, ..., 키 심볼 항목 수정
Now that the new type CTRL+ALT+SHIFT and definitions for the symbols F13, ..., F24 are defined, amend the key definitions for the function keys in. The one for is mentioned below, analogous definitions also need to be inserted for the other function keys:

After making these changes to, , and , and restarting the X server, switching from X directly to virtual terminals 13 and above is now possible - provided that these have been configured in the /etc/inittab (or systemd equivalent) of course.