Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(useHotKey): add composable for keyboard shortcuts #5899

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

Antreesy
Copy link
Contributor

@Antreesy Antreesy commented Aug 2, 2024

☑️ Resolves

Moved from nextcloud/spreed#12698

Add a new useHotKey composable with respect Nextcloud Accessibility setting
Available modifiers:

  • ctrl: Ctrl key is required
  • alt: Alt key is required
  • shift: Shift key is required
  • prevent: Prevent default action
  • stop: Stop propagation
  • push: Trigger on keydown and keyup

🖼️ Screenshots

image
image

🚧 Tasks

  • Define list of interactive elements

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

@Antreesy Antreesy added enhancement New feature or request 2. developing Work in progress labels Aug 2, 2024
@Antreesy Antreesy added this to the 8.16.0 milestone Aug 2, 2024
@Antreesy Antreesy self-assigned this Aug 2, 2024
@Antreesy Antreesy force-pushed the feat/noid/key-stroke-directive branch from ee0c7aa to acbcb4a Compare August 3, 2024 09:43
@Antreesy Antreesy marked this pull request as ready for review August 3, 2024 09:43
@Antreesy Antreesy added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 3, 2024
@Antreesy Antreesy modified the milestones: 8.16.0, 8.17.0 Aug 5, 2024
@Antreesy Antreesy force-pushed the feat/noid/key-stroke-directive branch from acbcb4a to c6522ad Compare August 19, 2024 16:25
@Antreesy Antreesy changed the title feat(KeyStroke): add directive for keyboard shortcuts feat(useKeyStroke): add composable for keyboard shortcuts Aug 19, 2024
@Antreesy Antreesy requested a review from ShGKme August 19, 2024 16:28
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about making it less a vueuse function wrapper, but more a specifically "hot keys" utility so that:

  • explicitly mark it as an utility for hotkeys
  • do not rely on vueuse and change implementation if needed
  • do not promise to support interface we actually don't need in hot keys

(discussed in the office)

docs/composables/usekeystroke.md Outdated Show resolved Hide resolved
src/composables/useKeyStroke/index.js Outdated Show resolved Hide resolved
src/composables/useKeyStroke/index.js Outdated Show resolved Hide resolved
src/composables/useKeyStroke/index.js Outdated Show resolved Hide resolved
src/composables/useKeyStroke/index.js Outdated Show resolved Hide resolved
docs/composables/usekeystroke.md Outdated Show resolved Hide resolved
@ShGKme
Copy link
Contributor

ShGKme commented Aug 20, 2024

Very cool docs!

Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Works fine, great examples in docs

docs/composables/useHotKey.md Outdated Show resolved Hide resolved
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy force-pushed the feat/noid/key-stroke-directive branch from 6060239 to 95dfaaa Compare August 20, 2024 17:19
@Antreesy Antreesy mentioned this pull request Aug 20, 2024
@Antreesy Antreesy changed the title feat(useKeyStroke): add composable for keyboard shortcuts feat(useHotKey): add composable for keyboard shortcuts Aug 20, 2024
@susnux susnux merged commit 32e4673 into master Aug 20, 2024
19 checks passed
@susnux susnux deleted the feat/noid/key-stroke-directive branch August 20, 2024 20:15
@susnux
Copy link
Contributor

susnux commented Aug 20, 2024

/backport to next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants