本页还没有译文
本页 17 段还没译成Русский,下面显示的是英文原文。resolveModifier
还没翻译译自英文(tanstack.com)本页 17 段都还没译
function resolveModifier(modifier, platform?): CanonicalModifier;Defined in: platform.ts:58
Resolves the platform-adaptive 'Mod' modifier to the appropriate canonical modifier.
The 'Mod' token represents the "primary modifier" on each platform:
- macOS: 'Meta' (Command key ⌘)
- Windows/Linux: 'Control' (Ctrl key)
This enables cross-platform hotkey definitions like 'Mod+S' that automatically map to Command+S on Mac and Ctrl+S on Windows/Linux.
Parameters
modifier
"Mod" | CanonicalModifier
The modifier to resolve. If 'Mod', resolves based on platform.
platform?
"mac" | "windows" | "linux"
The target platform. Defaults to auto-detection.
Returns
The canonical modifier name ('Control', 'Shift', 'Alt', or 'Meta')
Example
resolveModifier('Mod', 'mac') // 'Meta'
resolveModifier('Mod', 'windows') // 'Control'
resolveModifier('Control', 'mac') // 'Control' (unchanged)AI 翻译查看英文原文