JetpackCompose KeyBoard Options と Actions

# JetpackComposeのKeyBoard
TextFieldのパラメータでKeyboardの種類と完了時のActionを設定できる。
細かく把握してなかったので、UIの差異をまとめておく。

## KeyboardOptions

```
class KeyboardOptions constructor(
    val capitalization: KeyboardCapitalization = KeyboardCapitalization.None,
    val autoCorrect: Boolean = true,
    val keyboardType: KeyboardType = KeyboardType.Text,
    val imeAction: ImeAction = ImeAction.Default
)
```
KeyBoardの設定は上記クラスを使用して行う。

### KeyBoardType

| KeyBoardType | 説明 | 備考 |
| - | - | - |
| Text | 通常のキーボードを表示するIME | ![00.type-text.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/0a01bb87-6328-518d-b4f4-0342aff4b771.png)|
| Ascii | ASCII 文字の入力が可能な IME  | ![01.type-ascii.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/bf9a46e4-6053-8bb2-b9b8-9de746bf3f2e.png)|
| Number | 数字入力が可能なキーボード | ![02.type-number.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/2e5b5860-f253-a615-69d8-72eb999b492e.png)|
| Phone | 電話番号の入力が可能なIME | ![03.type-phone.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/3a78bf21-bb88-f060-bb29-a0a0ed2665c8.png) |
| Uri | URI を入力できる IME  | ![04.type-uri.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/a0e180de-1d8e-f6e3-2ceb-f527ebf680a9.png)|
| Email | メールアドレスを入力できるIME | ![05.type-email.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/b5bb0710-32bf-e549-7a15-f5894b7497cd.png)|
| Password | パスワード入力が可能なIME | ![06.type-password.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/5aed8e71-c797-a181-241e-a7e4369d3625.png)|
| NumberPassword | 数字パスワードの入力が可能 | ![07.type-numberpassword.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/4994a6c2-b562-6fd0-9a8d-301e14791506.png) |

### ImeAction

IME（インプットメソッド）の設定。後述のKeyboardActionsパラメータにて、タップ時の処理を実装できる。

| ImeOptions |  | 意味合い |
| - | - | - |
| Default | ![00.Default.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/a4530b69-c744-40c9-2544-1f61e226ae69.png)| 決定 |
| Done | ![01.Done.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/cdf37e41-a9c2-5836-6d86-ade12698f6c2.png) | ユーザの入力が終了 |
| Go | ![03.Go.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/0f38d084-6483-6873-e9d6-a4711516bc94.png)| 入力された値への移動 |
| Next | ![06.Next.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/2999bb47-10c5-6ce4-5eba-3aee7d3dd626.png)| 次の入力に移る |
| None | ![07.None.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/e271e7e2-e5e3-f181-7ec6-ec834e168d3f.png)| No Action |
| Previous | ![02.Previous.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/2364da86-cd0f-7cee-248b-d15bf72c0125.png)| 前の入力に戻る |
| Search | ![04.Serach.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/0a67411a-3892-5bf2-fcd0-097c8215c6c7.png)| 検索を開始 |
| Send | ![05.Send.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/700755/0f5cc274-286a-c3eb-97f0-efdfc54889b4.png) | 入力値を送信 |

### KeyboardCapitalization

大文字・小文字設定

| KeyboardCapitalization | 説明 
| - | - | - |
| Characters | 全大文字 |  
| None | 全小文字 |  
| Sentences | 文頭大文字 |  
| Words | 頭文字大文字 |  



## KeyboardActions

```imeAction.kt
TextField(
        value = text,
        onValueChange = onTextChanged,
        keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
        keyboardActions = KeyboardActions(onDone = {
            /* todo : do something */
            keyboardController?.hide() // ※ 明示的に閉じる時に使用
        })
    )
```

TextFieldでは上のように使用する。
KeyboardActions(onDone = ~~

## 終わり
QWERTY配列のほかテンキーもほぼ同様。