Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1016 Bytes

File metadata and controls

45 lines (28 loc) · 1016 Bytes
id convertToModFormat
title convertToModFormat

Function: convertToModFormat()

function convertToModFormat(hotkey, platform): Hotkey;

Defined in: parse.ts:353

Converts a hotkey string to use 'Mod' format for portability.

On macOS, converts 'Meta' to 'Mod'. On Windows/Linux, converts 'Control' to 'Mod'. This enables cross-platform hotkey definitions that work consistently.

Parameters

hotkey

The hotkey string to convert

Hotkey | string & object

platform

The target platform (defaults to auto-detection)

"mac" | "windows" | "linux"

Returns

Hotkey

The hotkey string with 'Mod' format applied

Example

convertToModFormat('Meta+S', 'mac') // 'Mod+S'
convertToModFormat('Control+S', 'windows') // 'Mod+S'
convertToModFormat('Control+Meta+S', 'mac') // 'Control+Meta+S' (both present, no conversion)