mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-11 17:48:44 -05:00
fix: use shift+r for reminder shortcut on apple devices
This commit is contained in:
@@ -3,6 +3,7 @@ import type {RouteLocation} from 'vue-router'
|
||||
import {isAppleDevice} from '@/helpers/isAppleDevice'
|
||||
|
||||
const ctrl = isAppleDevice() ? '⌘' : 'ctrl'
|
||||
const reminderModifier = isAppleDevice() ? 'shift' : 'alt'
|
||||
|
||||
export interface Shortcut {
|
||||
title: string
|
||||
@@ -182,7 +183,7 @@ export const KEYBOARD_SHORTCUTS: ShortcutGroup[] = [
|
||||
},
|
||||
{
|
||||
title: 'keyboardShortcuts.task.reminder',
|
||||
keys: ['alt', 'r'],
|
||||
keys: [reminderModifier, 'r'],
|
||||
},
|
||||
{
|
||||
title: 'keyboardShortcuts.task.description',
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
{{ $t('task.detail.actions.endDate') }}
|
||||
</XButton>
|
||||
<XButton
|
||||
v-shortcut="'Alt+r'"
|
||||
v-shortcut="reminderShortcut"
|
||||
variant="secondary"
|
||||
:icon="['far', 'clock']"
|
||||
@click="setFieldActive('reminders')"
|
||||
@@ -640,6 +640,7 @@ import Reactions from '@/components/input/Reactions.vue'
|
||||
|
||||
import {uploadFile} from '@/helpers/attachments'
|
||||
import {getProjectTitle} from '@/helpers/getProjectTitle'
|
||||
import {isAppleDevice} from '@/helpers/isAppleDevice'
|
||||
import {scrollIntoView} from '@/helpers/scrollIntoView'
|
||||
import {TASK_REPEAT_MODES} from '@/types/IRepeatMode'
|
||||
import {playPopSound} from '@/helpers/playPop'
|
||||
@@ -710,6 +711,10 @@ const lastProject = computed(() => {
|
||||
|
||||
const lastProjectOrTaskProject = computed(() => lastProject.value ?? project.value)
|
||||
|
||||
// Use Shift+R on macOS (Alt+R produces special characters depending on keyboard layout)
|
||||
// Use Alt+r on other platforms
|
||||
const reminderShortcut = computed(() => isAppleDevice() ? 'Shift+R' : 'Alt+r')
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('keydown', saveTaskViaHotkey)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user