「シリアル入力デバイスからカーネル入力へ」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版から転載)
 
(翻訳)
1行目: 1行目:
 
[[Category:入力デバイス]]
 
[[Category:入力デバイス]]
 
[[en:Serial input device to kernel input]]
 
[[en:Serial input device to kernel input]]
  +
USB はマウスなどの入力デバイスを接続する最も一般的な方法ですが、古いマウスなどのシリアル入力デバイスや、3Dconnexion Spaceball などのより特殊な入力デバイスは、コンピューターに内蔵されたシリアルポート、または USB - シリアル変換ドングルを介して、依然として非常に実用的に使用できます。
Although USB is the most popular way to connect input devices such as mice, serial input devices, such as older mice, and more exotic input devices such as 3Dconnexion Spaceballs are still quite usable, either with a serial port built into the computer, or via a USB to serial converter dongle.
 
   
  +
これらのシリアル接続された入力デバイスをサポートする従来の方法は、入力デバイスが接続されているシリアルポートやデバイスが使用するプロトコルなどの詳細を各アプリケーションで構成することでした。シリアル入力デバイスで使用する最も一般的なアプリケーションは X.org/XFree86 だったため、これは大きな問題ではありませんでした。ただし、シリアル入力デバイスと直接通信する必要があるさまざまなアプリケーションを使用する場合、各アプリケーションがサポートするシリアル入力デバイスまたはプロトコルの制限に遭遇する可能性があります。一部のアプリケーションは、使用したかったシリアル入力デバイスをサポートしていなかった可能性があります。
The traditional way to support these serially attached input devices was to configure '''each''' application with the details such as which serial port the input device was attached to and what protocol the device used. As the most common application people used with a serial input device was X.org / XFree86, this was not too much of a problem. However, if you used a variety of applications that needed to talk to the serial input device directly, you may encounter limitations to which serial input device or protocol each application supported. Some applications may not have supported a serial input device you would have preferred to use.
 
   
  +
より良いアプローチは、Linux カーネル入力サブシステムにシリアル接続された入力デバイスを管理させ、USB および PS/2 入力デバイス信号が {{ic|/dev/input/''device''}} ファイルを介してアプリケーションに提示されるのと同じ方法で、デバイスが生成する入力信号を提示させることです。
A better approach is to have the Linux kernel input subsystem manage the serially attached input device, and then present the input signals the device generates in the same way that USB and PS/2 input device signals are presented to applications, via the {{ic|/dev/input/''device''}} files.
 
   
  +
このガイドでは、シリアル入力デバイスを Linux カーネル入力サブシステムに "接続" するために必要な簡単な手順について説明します。
This guide describes the simple steps necessary to "attach" a serial input device to the Linux kernel input subsystem.
 
   
== Installation ==
+
== インストール ==
   
  +
{{Pkg|linuxconsole}} パッケージを [[インストール]] します。''inputattach'' ユーティリティは、どのシリアルポートに入力デバイスが接続されているか、および指定されたシリアルポートにどの種類のデバイスが接続されているかをカーネル入力サブシステムに通知します。
[[Install]] the {{Pkg|linuxconsole}} package: the ''inputattach'' utility tells the kernel input subsystem which serial port the input device is attached to, and what type of device is attached to the specified serial port.
 
  +
設定
   
  +
インストールしたら、{{ic|inputattach --help}} を表示して、Linux カーネル入力サブシステムがサポートするシリアル入力デバイスの膨大なリストを確認します。
== Configuration ==
 
   
  +
たとえば、Logitech TrackMan Marble シリアルマウスを使用している場合は、{{ic|--mouseman}}/{{ic|-mman}} を指定します。
Once installed, view the {{ic|inputattach --help}}, to see the large list of serial input devices the Linux kernel input subsystem supports.
 
   
  +
デフォルトの設定ファイルは、Microsoft シリアルマウスを想定しており、マウスがコンピューターの最初のシリアルポートに接続されていることを想定しています。{{ic|'IAPARAMS'}} 変数は、inputattach 引数の配列です。inputattach インスタンスは、各要素に対して開始されます。引数の詳細については、{{ic|inputattach --help}} を参照してください。
For example, if you have a Logitech TrackMan Marble serial mouse you would specify {{ic|--mouseman}}/{{ic|-mman}}.
 
   
  +
Logitech TrackMan Marble シリアルマウスに合わせて変更された構成例を次に示します。
The default configuration file assumes a Microsoft serial mouse, and assumes the mouse is attached to the first serial port of the computer. The {{ic|'IAPARAMS'}} variable is an array of inputattach arguments. An inputattach instance will be started for each element. See {{ic|inputattach --help}} for details on arguments.
 
 
Here is an example configuration, modified to suit a Logitech TrackMan Marble serial mouse:
 
   
 
{{hc|/etc/conf.d/inputattach|2=
 
{{hc|/etc/conf.d/inputattach|2=
  +
Configuration for inputattach
#
 
  +
IAPARAMS is an array of inputattach arguments, see 'inputattach --help'.
# Configuration for inputattach
 
  +
An inputattach instance will be started for each element.
#
 
# IAPARAMS is an array of inputattach arguments, see 'inputattach --help'.
 
# An inputattach instance will be started for each element.
 
   
 
IAPARAMS=(
 
IAPARAMS=(
35行目: 32行目:
 
}}
 
}}
   
== Usage ==
+
== 使い方 ==
   
[[Start]] {{ic|inputattach.service}}.
+
{{ic|inputattach.service}} を [[起動]] します。
   
  +
この処理を Xorg 内で行っている場合、{{ic|/dev/input/mice}} を入力デバイスファイルとして指定する {{ic|InputDevice}} マウスセクションがあると、新しい入力デバイスは、他の入力デバイス (たとえば USB マウス) に加えて、Xorg マウスポインターの動きの別のソースになる可能性があります。
If you happen to be within Xorg when you do this, and have an {{ic|InputDevice}} mouse section that specifies {{ic|/dev/input/mice}} as the input device file, your new input device is likely to now be another source for Xorg mouse pointer movements, in addition to other input devices e.g., a USB mouse.
 
   
  +
処理が成功したことを確認するもう 1 つの方法は、[[dmesg]] ユーティリティを使用してシステムのカーネルログを確認することです。Logitech TrackMan Marble シリアルマウスの場合、カーネル出力は次のようになります。
Another way to confirm that it worked is to check your system's kernel log using the [[dmesg]] utility. For a Logitech TrackMan Marble serial mouse, the kernel output is:
 
   
serio: Serial port ttyS0
+
serio: Serial port ttyS0
 
input: Logitech M+ Mouse as /class/input/input6
 
input: Logitech M+ Mouse as /class/input/input6
   
  +
シリアル入力デバイスを起動するたびに機能させるには、{{ic|inputattach.service}} を [[有効化]] します。
To have your serial input device work every time you boot, [[enable]] {{ic|inputattach.service}}.
 

2025年2月15日 (土) 04:42時点における版

USB はマウスなどの入力デバイスを接続する最も一般的な方法ですが、古いマウスなどのシリアル入力デバイスや、3Dconnexion Spaceball などのより特殊な入力デバイスは、コンピューターに内蔵されたシリアルポート、または USB - シリアル変換ドングルを介して、依然として非常に実用的に使用できます。

これらのシリアル接続された入力デバイスをサポートする従来の方法は、入力デバイスが接続されているシリアルポートやデバイスが使用するプロトコルなどの詳細を各アプリケーションで構成することでした。シリアル入力デバイスで使用する最も一般的なアプリケーションは X.org/XFree86 だったため、これは大きな問題ではありませんでした。ただし、シリアル入力デバイスと直接通信する必要があるさまざまなアプリケーションを使用する場合、各アプリケーションがサポートするシリアル入力デバイスまたはプロトコルの制限に遭遇する可能性があります。一部のアプリケーションは、使用したかったシリアル入力デバイスをサポートしていなかった可能性があります。

より良いアプローチは、Linux カーネル入力サブシステムにシリアル接続された入力デバイスを管理させ、USB および PS/2 入力デバイス信号が /dev/input/device ファイルを介してアプリケーションに提示されるのと同じ方法で、デバイスが生成する入力信号を提示させることです。

このガイドでは、シリアル入力デバイスを Linux カーネル入力サブシステムに "接続" するために必要な簡単な手順について説明します。

インストール

linuxconsole パッケージを インストール します。inputattach ユーティリティは、どのシリアルポートに入力デバイスが接続されているか、および指定されたシリアルポートにどの種類のデバイスが接続されているかをカーネル入力サブシステムに通知します。 設定

インストールしたら、inputattach --help を表示して、Linux カーネル入力サブシステムがサポートするシリアル入力デバイスの膨大なリストを確認します。

たとえば、Logitech TrackMan Marble シリアルマウスを使用している場合は、--mouseman/-mman を指定します。

デフォルトの設定ファイルは、Microsoft シリアルマウスを想定しており、マウスがコンピューターの最初のシリアルポートに接続されていることを想定しています。'IAPARAMS' 変数は、inputattach 引数の配列です。inputattach インスタンスは、各要素に対して開始されます。引数の詳細については、inputattach --help を参照してください。

Logitech TrackMan Marble シリアルマウスに合わせて変更された構成例を次に示します。

/etc/conf.d/inputattach
Configuration for inputattach
IAPARAMS is an array of inputattach arguments, see 'inputattach --help'.
An inputattach instance will be started for each element.

IAPARAMS=(
  "--mouseman /dev/ttyS0"
)

使い方

inputattach.service起動 します。

この処理を Xorg 内で行っている場合、/dev/input/mice を入力デバイスファイルとして指定する InputDevice マウスセクションがあると、新しい入力デバイスは、他の入力デバイス (たとえば USB マウス) に加えて、Xorg マウスポインターの動きの別のソースになる可能性があります。

処理が成功したことを確認するもう 1 つの方法は、dmesg ユーティリティを使用してシステムのカーネルログを確認することです。Logitech TrackMan Marble シリアルマウスの場合、カーネル出力は次のようになります。

serio: Serial port ttyS0

input: Logitech M+ Mouse as /class/input/input6

シリアル入力デバイスを起動するたびに機能させるには、inputattach.service有効化 します。