103103 taggable
104104 @option :selected =" setDefaultQuota " />
105105 </NcAppSettingsSection >
106+
107+ <NcAppSettingsShortcutsSection >
108+ <NcHotkeyList :label =" t (' settings' , ' Search' )" >
109+ <NcHotkey :label =" t (' settings' , ' Focus search' )" hotkey="Control F" />
110+ </NcHotkeyList >
111+ <NcHotkeyList :label =" t (' settings' , ' Help' )" >
112+ <NcHotkey :label =" t (' settings' , ' Show those shortcuts' )" hotkey="?" />
113+ </NcHotkeyList >
114+ </NcAppSettingsShortcutsSection >
106115 </NcAppSettingsDialog >
107116</template >
108117
109118<script >
110119import axios from ' @nextcloud/axios'
111120import { formatFileSize , parseFileSize } from ' @nextcloud/files'
112121import { generateUrl } from ' @nextcloud/router'
122+ import { useHotKey } from ' @nextcloud/vue/composables/useHotKey'
123+ import { nextTick } from ' vue'
113124import NcAppSettingsDialog from ' @nextcloud/vue/components/NcAppSettingsDialog'
114125import NcAppSettingsSection from ' @nextcloud/vue/components/NcAppSettingsSection'
126+ import NcAppSettingsShortcutsSection from ' @nextcloud/vue/components/NcAppSettingsShortcutsSection'
115127import NcCheckboxRadioSwitch from ' @nextcloud/vue/components/NcCheckboxRadioSwitch'
128+ import NcHotkey from ' @nextcloud/vue/components/NcHotkey'
129+ import NcHotkeyList from ' @nextcloud/vue/components/NcHotkeyList'
116130import NcNoteCard from ' @nextcloud/vue/components/NcNoteCard'
117131import NcSelect from ' @nextcloud/vue/components/NcSelect'
118132import { GroupSorting } from ' ../../constants/GroupManagement.ts'
@@ -125,7 +139,10 @@ export default {
125139 components: {
126140 NcAppSettingsDialog,
127141 NcAppSettingsSection,
142+ NcAppSettingsShortcutsSection,
128143 NcCheckboxRadioSwitch,
144+ NcHotkey,
145+ NcHotkeyList,
129146 NcNoteCard,
130147 NcSelect,
131148 },
@@ -137,6 +154,20 @@ export default {
137154 },
138155 },
139156
157+ emits: [' update:open' ],
158+
159+ setup (_ , { emit }) {
160+ // ? opens the settings dialog on the keyboard shortcuts section
161+ useHotKey (' ?' , async () => {
162+ emit (' update:open' , true )
163+ await nextTick ()
164+ document .getElementById (' settings-section_keyboard-shortcuts' )? .scrollIntoView ({
165+ behavior: ' smooth' ,
166+ inline: ' nearest' ,
167+ })
168+ }, { stop: true , prevent: true })
169+ },
170+
140171 data () {
141172 return {
142173 selectedQuota: false ,
0 commit comments