「Xorg での特別なキーボードキー」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の3版が非表示)
2行目: 2行目:
 
[[Category:X サーバー]]
 
[[Category:X サーバー]]
 
[[en:Extra keyboard keys in Xorg]]
 
[[en:Extra keyboard keys in Xorg]]
[[ru:Extra Keyboard Keys in Xorg]]
+
[[ru:Extra keyboard keys in Xorg]]
  +
[[tr:X sunucusunda ek klavye tuşları]]
[[tr:X_sunucusunda_ek_klavye_tuşları]]
 
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|特別なキーボードキー}}
 
{{Related|特別なキーボードキー}}
14行目: 14行目:
 
== キーシムをアクションにマップ ==
 
== キーシムをアクションにマップ ==
   
  +
グラフィカル環境でも、特定のキーの組み合わせを押した時にコマンドを実行したいという場合があるかもしれません。複数の方法で実現できます:
When we are in a graphical environment we may want to execute a command when certain key combination is pressed. There are multiple ways to do that:
 
   
  +
* [[acpid]] などのローレベルなツールを使用する最も移植性の高い方法。全てのキーがサポートされているわけではありませんが、AC アダプタの接続やヘッドフォンジャックの接続時のイベントと同じ方法でキーボードキーを設定できます。X セッションの中でプログラムを正しく実行しようとすると中々大変です。
* The most portable way using low level tools, such as [[acpid]]. Not all keys are supported, but configuration in uniform way is possible for keyboard keys, power adapter connection and even headphone jack (un)plugging events. It is also difficult to run programs inside X session correctly.
 
  +
* [[Xorg]] のユーティリティ (例: [[xbindkeys]]) やデスクトップ環境・ウィンドウマネージャのツールを使用する一般的な方法。
* The universal way using [[Xorg]] utilities (e.g. [[xbindkeys]]) and eventually your desktop environment or window manager tools.
 
  +
* Gnome Control Center や [[en2:Keytouch|Keytouch]] など、全て GUI で設定するサードパーティ製のプログラムを使う手軽な方法。
* The quicker way using a third-party program to do everything in GUI, such as the Gnome Control Center or [[Keytouch]].
 
   
 
=== デスクトップ環境 ===
 
=== デスクトップ環境 ===
24行目: 24行目:
 
==== Gnome ====
 
==== Gnome ====
   
  +
特別なキーボードキーの管理は Gnome Control Center で全てが整います。スキャンコードを直接扱えるため、カーネルから認識されるキーは全てマッピングできます。
Gnome Control Center is quite complete for the extra keyboard keys management. In fact it can directly detect scancodes which means that it can map any key seen by the kernel.
 
   
 
==== KDE ====
 
==== KDE ====
32行目: 32行目:
 
==== Xfce4 ====
 
==== Xfce4 ====
   
[[Xfce#Keyboard_Shortcuts]] を見て下さい。
+
[[Xfce#キーボードショートカット]] を見て下さい。
   
 
=== ウィンドウマネージャ ===
 
=== ウィンドウマネージャ ===
43行目: 43行目:
   
 
[[PekWM#ホットキー]] を見て下さい。
 
[[PekWM#ホットキー]] を見て下さい。
 
==== Xmonad ====
 
 
If you use Xmonad as a stand alone window manager, you can edit the xmonad.hs to add unbound keyboard keys. You just need to find the Xf86 name of the key (such as XF86PowerDown) and look it up in {{Ic|/usr/include/X11/XF86keysym.h}}. It will give you a keycode (like 0x1008FF2A) which you can use to add a line like the following in the keybindings section of your {{ic|xmonad.hs}}:
 
 
((0, 0x1008FF2A), spawn "sudo pm-suspend")
 
 
==== i3 ====
 
 
Open your ~/.i3/config and just bind the keysym to a command:
 
 
bindsym XF86AudioLowerVolume exec amixer -q set Master 5-
 
bindsym XF86AudioRaiseVolume exec amixer -q set Master 5+
 
bindsym XF86AudioMute exec $(amixer get Master | grep off > /dev/null && amixer -q set Master unmute) || amixer -q set Master mute
 
bindsym XF86MonBrightnessDown exec xbacklight -dec 10
 
bindsym Print exec scrot
 
   
 
=== サードパーティのツール ===
 
=== サードパーティのツール ===
64行目: 48行目:
 
==== sxhkd ====
 
==== sxhkd ====
   
  +
強力かつコンパクトな設定構文によるシンプルな X ホットキーデーモン。
A simple X hotkey daemon with a powerful and compact configuration syntax.
 
   
Available as {{AUR|sxhkd-git}} and {{AUR|sxhkd}} in [[AUR]].
+
[[公式リポジトリ]]の {{Pkg|sxhkd}} や [[AUR]] の {{AUR|sxhkd-git}} でインストールできます。詳しくは [[sxhkd]] を参照。
   
 
==== keytouch ====
 
==== keytouch ====
   
  +
KeyTouch はキーボードの特殊なファンクションキーを簡単に設定できるプログラムです。個々のファンクションキーが押された時に何を行うかを定義することができます。
KeyTouch is a program which allows you to easily configure the extra function keys of your keyboard. This means that you can define, for every individual function key, what to do if it is pressed.
 
   
See the main article: [[keytouch]].
+
次の記事を参照してください: [[en2:keytouch|keytouch]]
   
 
==== actkbd ====
 
==== actkbd ====
   
From [http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/ actkbd home page]:
+
[http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/ actkbd のホームページ] より:
  +
:{{AUR|actkbd}} はアクションをキーボードイベントにバインドするシンプルなデーモンです。キーコンビネーションを認識してプレス・リピート・リリース時のイベントを管理できます。今のところ linux-2.6 の evdev インターフェイスだけをサポートしています。平文の設定ファイルを使って全てのバインディングを記述します。
:{{AUR|actkbd}} (available in [[AUR]]) is a simple daemon that binds actions to keyboard events. It recognises key combinations and can handle press, repeat and release events. Currently it only supports the linux-2.6 evdev interface. It uses a plain-text configuration file which contains all the bindings.
 
   
A sample configuration and guide is available [http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/latest/README here].
+
設定例やガイドは [http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/latest/README こちら] にあります。
   
 
==== xbindkeys ====
 
==== xbindkeys ====
   
  +
[[xbindkeys]] はデスクトップ環境とは独立してキーシムをアクションにマッピングすることができます。
[[xbindkeys]] allows advanced mapping of keysyms to actions independently of the Desktop Environment.
 
{{Tip| If you find {{ic|xbindkeys}} difficult to use, try the graphical manager {{AUR|xbindkeys_config}} from the [[AUR]].}}
+
{{Tip|{{ic|xbindkeys}} が使いにくいと思われる場合、[[AUR]] にあるグラフィカルマネージャ {{AUR|xbindkeys_config-gtk2}} を試してみて下さい。}}

2016年1月10日 (日) 15:59時点における版

関連記事

キーシムをアクションにマップ

グラフィカル環境でも、特定のキーの組み合わせを押した時にコマンドを実行したいという場合があるかもしれません。複数の方法で実現できます:

  • acpid などのローレベルなツールを使用する最も移植性の高い方法。全てのキーがサポートされているわけではありませんが、AC アダプタの接続やヘッドフォンジャックの接続時のイベントと同じ方法でキーボードキーを設定できます。X セッションの中でプログラムを正しく実行しようとすると中々大変です。
  • Xorg のユーティリティ (例: xbindkeys) やデスクトップ環境・ウィンドウマネージャのツールを使用する一般的な方法。
  • Gnome Control Center や Keytouch など、全て GUI で設定するサードパーティ製のプログラムを使う手軽な方法。

デスクトップ環境

Gnome

特別なキーボードキーの管理は Gnome Control Center で全てが整います。スキャンコードを直接扱えるため、カーネルから認識されるキーは全てマッピングできます。

KDE

キーボードショートカットは System Settings -> Shortcuts and Gestures で設定できます。

Xfce4

Xfce#キーボードショートカット を見て下さい。

ウィンドウマネージャ

Openbox

Openbox#キーバインド を見て下さい。

PekWM

PekWM#ホットキー を見て下さい。

サードパーティのツール

sxhkd

強力かつコンパクトな設定構文によるシンプルな X ホットキーデーモン。

公式リポジトリsxhkdAURsxhkd-gitAUR でインストールできます。詳しくは sxhkd を参照。

keytouch

KeyTouch はキーボードの特殊なファンクションキーを簡単に設定できるプログラムです。個々のファンクションキーが押された時に何を行うかを定義することができます。

次の記事を参照してください: keytouch

actkbd

actkbd のホームページ より:

actkbdAUR はアクションをキーボードイベントにバインドするシンプルなデーモンです。キーコンビネーションを認識してプレス・リピート・リリース時のイベントを管理できます。今のところ linux-2.6 の evdev インターフェイスだけをサポートしています。平文の設定ファイルを使って全てのバインディングを記述します。

設定例やガイドは こちら にあります。

xbindkeys

xbindkeys はデスクトップ環境とは独立してキーシムをアクションにマッピングすることができます。

ヒント: xbindkeys が使いにくいと思われる場合、AUR にあるグラフィカルマネージャ xbindkeys_config-gtk2AUR を試してみて下さい。