

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 啟用觸控螢幕和手寫筆支援
<a name="enable-stylus"></a>

**注意**  
 不需要觸控螢幕和手寫筆裝置的 USB 重新導向。此外，不需要在 Amazon DCV 伺服器上安裝廠商驅動程式。  
Amazon DCV 使用原生作業系統 APIs 支援觸控螢幕和手寫筆。  
Windows 使用 Windows Ink。  
Linux 使用 X11 輸入注入。
+ **Windows 伺服器支援**

  所有支援的 Windows 作業系統都支援觸控螢幕。從 Windows 10 和 Windows 2019 開始，所有支援的 Windows 作業系統都支援手寫筆，Windows 2016、Windows 8.1 和舊版不支援這些手寫筆。根據預設，這些功能會在 Windows Amazon DCV 伺服器上啟用。不需任何其他設定。
+ **Linux 伺服器支援**

  所有支援的 Linux 作業系統都支援觸控螢幕和觸控筆。這些功能預設會在 Linux Amazon DCV 伺服器上託管的虛擬工作階段上啟用。不過，需要一些額外的組態，才能在 Linux Amazon DCV 伺服器上託管的主控台工作階段上啟用 功能。

**重要**  
 如果在*用戶端和伺服器上都*支援此功能，並在伺服器上啟用此功能，則會啟用搭配 Amazon DCV 使用的觸控螢幕和觸控筆。如需用戶端支援的相關資訊，請參閱[《Amazon DCV 使用者指南》中的用戶端功能](https://docs.aws.amazon.com/dcv/latest/userguide/client.html#client-features)。 **

**為 Linux Amazon DCV 伺服器上託管的主控台工作階段啟用觸控螢幕和手寫筆支援**

1. 使用您偏好的文字編輯器開啟 `/etc/X11/xorg.conf`。

1. 將下列區段新增至檔案。

   ```
   Section "InputDevice"
     Identifier "DCV Stylus Pen"
     Driver "dcvinput"
   EndSection
   
   Section "InputDevice"
     Identifier "DCV Stylus Eraser"
     Driver "dcvinput"
   EndSection
   
   Section "InputDevice"
     Identifier "DCV Touchscreen"
     Driver "dcvinput"
   EndSection
   ```

1. 將下列內容新增至 `ServerLayout` 區段。

   ```
   InputDevice  "DCV Stylus Pen"
   InputDevice  "DCV Stylus Eraser"
   InputDevice  "DCV Touchscreen"
   ```

   例如：

   ```
   Section "ServerLayout"
     ...existing content...
     InputDevice  "DCV Stylus Pen"
     InputDevice  "DCV Stylus Eraser"
     InputDevice  "DCV Touchscreen"
   EndSection
   ```

1. 儲存變更並關閉 檔案。

1. 重新啟動 X 伺服器。
   + RHEL、Rocky、CentOS、Amazon Linux 2、Ubuntu 和 SUSE Linux Enterprise 12.x

     ```
     $ sudo systemctl isolate multi-user.target
     ```

     ```
     $ sudo systemctl isolate graphical.target
     ```

1. 若要確定輸入裝置已正確設定，請執行下列命令。

   ```
   $ sudo DISPLAY=:0 xinput
   ```

   DCV 手寫筆、DCV 手寫筆清除器和 DCV 觸控螢幕會顯示在命令輸出中。以下為範例輸出。

   ```
   | Virtual core pointer                          id=2    [master pointer  (3)]
   |   | Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
   |   | dummy_mouse                               id=6    [slave  pointer  (2)]
   |   | dummy_keyboard                            id=7    [slave  pointer  (2)]
   |   | DCV Stylus Pen                            id=8    [slave  pointer  (2)]
   |   | DCV Stylus Eraser                         id=9    [slave  pointer  (2)]
   |   | DCV Touchscreen                           id=10   [slave  pointer  (2)]
   | Virtual core keyboard                         id=3    [master keyboard (2)]
       | Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
   ```

## 設定手寫筆壓力範圍
<a name="config-stylus-pressure"></a>

有些應用程式會要求您將手寫筆壓力範圍降至 0 到 2048。您可以在 `/etc/X11/xorg.conf` 檔案中將 `Pressure2k`選項設定為 true，以設定壓力範圍。

**設定手寫筆壓力**

1. 使用您偏好的文字編輯器開啟 `/etc/X11/xorg.conf`。

1. 將下列區段新增至檔案。

   ```
   Section "InputDevice"
     Identifier "DCV Stylus Pen"
     Driver "dcvinput"
     Option "Pressure2K" "true"
   EndSection
   
   Section "InputDevice"
     Identifier "DCV Stylus Eraser"
     Driver "dcvinput"
     Option "Pressure2K" "true"
   EndSection
   ```

1. 儲存變更並關閉 檔案。

1. 重新啟動 X 伺服器。