ionic-team / ionic-team/capacitor-keyboard

Support iOS `UIKeyCommand` for Registering keyboard shortcuts (discoverability).

Open
#15 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3
Forks
21
PR merge metrics
No merged PRs in 30d

Description

## Feature Request

### Plugin

Keyboard

### Description

It would be an awesome accessibility feature if we could tie in to `UIKeyCommand` (as a no-op), to register application keyboard shortcuts so that they appear in the iOS keyboard shortcut discoverability list:

https://www.hackingwithswift.com/example-code/uikit/how-to-use-uikeycommand-to-add-keyboard-shortcuts

![image](https://user-images.githubusercontent.com/362329/201176681-2b3d8d09-b50f-463f-b8f5-ed253ba2ffcd.png)

### Platform(s)

iOS

### Preferred Solution

`Keyboard.registerKeyCommand(input: string, modifiers: string[], action: () => void, discoverabilityTitle: string);`

If no action is provided, this would delegate to the Dom/WebView keyboard event listener. If an action is provided, the action would be called, but it would allow us to add items to this list:

I don't think there is an equivalent on Android / Web, but it would be nice if there were.

### Alternatives

None. Show keyboard shortcuts in-app via custom UI implementation.

### Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.