mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(defineShortcuts): bring back meta to ctrl convert on non macos platforms
Resolves #3869, resolves #3318 Co-Authored-By: Sylvain Marroufin <marroufin.sylvain@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ defineShortcuts({
|
||||
</script>
|
||||
```
|
||||
|
||||
- Shortcuts are automatically adjusted for non-macOS platforms, converting `meta` to `ctrl`.
|
||||
- The composable uses VueUse's [`useEventListener`](https://vueuse.org/core/useEventListener/) to handle keydown events.
|
||||
- For a complete list of available shortcut keys, refer to the [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values) API documentation. Note that the key should be written in lowercase.
|
||||
|
||||
@@ -46,7 +47,7 @@ Shortcuts are defined using the following format:
|
||||
|
||||
#### Modifiers
|
||||
|
||||
- `meta`: Represents `⌘ Command` on macOS and `⊞ Windows` on Windows
|
||||
- `meta`: Represents `⌘ Command` on macOS and `Ctrl` on other platforms
|
||||
- `ctrl`: Represents `Ctrl` on all platforms
|
||||
- `shift`: Used for alphabetic keys when Shift is required
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
You can pass special keys to the `value` prop that goes through the [`useKbd`](https://github.com/nuxt/ui/blob/v3/src/runtime/composables/useKbd.ts) composable. For example, the `meta` key displays as `⌘` on macOS and `⊞` on other platforms.
|
||||
You can pass special keys to the `value` prop that goes through the [`useKbd`](https://github.com/nuxt/ui/blob/v3/src/runtime/composables/useKbd.ts) composable. For example, the `meta` key displays as `⌘` on macOS and `Ctrl` on other platforms.
|
||||
|
||||
::component-code
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user