Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
キーボード入力のソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
キーボード入力
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:キーボード設定]] [[de:Hotkeys]] [[en:Keyboard input]] [[ru:Keyboard input]] {{Related articles start}} {{Related|特別なキーボードキー}} {{Related|入力リマップユーティリティ}} {{Related articles end}} キーマッピングを変更する前に、キーを押した結果どの記号になるかを知っておく必要があります: # The keyboard sends a [[Wikipedia:Scancode|scancode]] to the computer. # The Linux kernel maps the scancode to a '''keycode''', see [[Map scancodes to keycodes]]. # The [[Wikipedia:Keyboard layout|keyboard layout]] maps the keycode to a symbol or '''keysym''', depending on what [[Wikipedia:Modifier key|modifier keys]] are pressed. #* For the [[Linux console]], see [[Linux console/Keyboard configuration]]. #* For [[Xorg]] and [[Wayland]], see [[Xorg/Keyboard configuration]]. Most of your keys should already have a ''keycode'', or at least a ''scancode''. Keys without a ''scancode'' are not recognized by the kernel; these can include additional keys from "gaming" keyboards, etc. In Xorg, some ''keysyms'' (e.g. {{ic|XF86AudioPlay}}, {{ic|XF86AudioRaiseVolume}} etc.) can be mapped to actions (i.e. launching an external application). See [[Keyboard shortcuts#Xorg]] for details. In Linux console, some ''keysyms'' (e.g. {{ic|F1}} to {{ic|F246}}) can be mapped to certain actions (e.g. switch to other console or print some sequence of characters). See [[Console keyboard configuration#Creating a custom keymap]] for details. == スキャンコードの確認 == === showkey を使う === The traditional way to get a ''scancode'' is to use the {{man|1|showkey}} utility. ''showkey'' waits for a key to be pressed, or exits if no keys are pressed within 10 seconds. For ''showkey'' to work you need to be in a [[Wikipedia:Virtual console|virtual console]], not in a graphical environment or logged in via a network connection. Run the following command: # showkey --scancodes and try to push keyboard keys; you should see ''scancodes'' being printed to the output. === evtest を使う === For USB keyboards, it is apparently necessary to use {{man|1|evtest}} from the {{Pkg|evtest}} package instead of ''showkey'' [https://web.archive.org/web/20210620050100/https://askbot.fedoraproject.org/en/question/46201/how-to-map-scancodes-to-keycodes/]: {{hc|# evtest /dev/input/event12| ... Event: time 1434666536.001123, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70053 Event: time 1434666536.001123, type 1 (EV_KEY), code 69 (KEY_NUMLOCK), value 0 Event: time 1434666536.001123, -------------- EV_SYN ------------ }} {{Tip|If you do not know which event number has device of your interest, you can run {{ic|evtest}} without parameters and it will show you list of devices with their event numbers, then you can enter needed number.}} Use the "value" field of {{ic|MSC_SCAN}}. This example shows that NumLock has scancode 70053 and keycode 69. === dmesg を使う === {{Note|This method only identifies unknown keys.}} You can get the ''scancode'' of a key by pressing the desired key and looking at the output of [[dmesg]]. For example, if you get: Unknown key pressed (translated set 2, code 0xa0 on isa0060/serio0 then the ''scancode'' you need is {{ic|0xa0}}. == キーコードを確認する == The Linux keycodes are defined in {{ic|/usr/include/linux/input-event-codes.h}} (see the {{ic|KEY_}} variables). === コンソールでキーコードを確認する === The ''keycodes'' for [[virtual console]] are reported by the {{man|1|showkey}} utility. ''showkey'' waits for a key to be pressed and if none are, in a span of 10 seconds, it quits. To execute ''showkey'', you need to be in a virtual console, not in a graphical environment. Run the following command: # showkey --keycodes and try to push keyboard keys; you should see ''keycodes'' being printed to the output. === Xorg でキーコードを確認する === {{Expansion|xev also reports keysyms. Mention that you need to focus the "Event Tester" window.}} {{Note|The Xorg ''keycodes'' are 8 larger than the Linux ''keycodes''.[https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev/-/blob/master/src/evdev.c]}} The ''keycodes'' used by [[Xorg]] are reported by a utility called {{man|1|xev}}, which is provided by the {{Pkg|xorg-xev}} package. Of course to execute ''xev'', you need to be in a graphical environment, not in the console. With the following command you can start ''xev'' and show only the relevant parts: $ xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }' Here is an example output: 38 a 55 v 54 c 50 Shift_L 133 Super_L 135 Menu [[Xbindkeys#Identifying keycodes|Xbindkeys]] is another wrapper to ''xev'' that reports ''keycodes''. If you press a key and nothing appears in the terminal, it means that either the key does not have a ''scancode'', the ''scancode'' is not mapped to a ''keycode'', or some other process is capturing the keypress. If you suspect that a process listening to X server is capturing the keypress, you can try running ''xev'' from a clean X session: $ xinit /usr/bin/xterm -- :1 == 参照 == * [https://kbd-project.org/ kbd-project - showkeys ユーティリティの公式ページ] * [https://git.sr.ht/~sircmpwn/wev wev] - xorg の xev に似た wayland イベントビューア
このページで使用されているテンプレート:
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:META Related articles start
(
ソースを閲覧
)
テンプレート:Man
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
テンプレート:Related
(
ソースを閲覧
)
テンプレート:Related articles end
(
ソースを閲覧
)
テンプレート:Related articles start
(
ソースを閲覧
)
テンプレート:Tip
(
ソースを閲覧
)
テンプレート:TranslationStatus
(
ソースを閲覧
)
キーボード入力
に戻る。
検索
検索
キーボード入力のソースを表示
話題を追加