Company
Date Published
Author
Adaobi Aniuchi
Word count
1890
Language
English
Hacker News points
None

Summary

In this article, we learned how to add keyboard shortcuts for call controls in a Daily-powered video app built with Vue.js using the VueUse utility library and the Composition API hook setup. We covered two possible implementations of this feature: The setup composition API hook and the more recent and standard `<script setup>` syntax. We also discussed the library we intend to use for this feature, which is the VueUse package. Additionally, we learned how to make our demo compatible with VueUse by modifying the `<script>` section. We then added the functionality for toggling the audio or video inside the setup hook using combinations and whenever. Finally, we notified users about the keyboard shortcuts for call controls by providing awareness of this feature through the `title` html attribute for each of the call control buttons.