Skip to content

Commit 5ff9ecf

Browse files
committed
docs(keyboard): document Meta key aliases and cross-platform usage
Update keyboard documentation to explain the Meta/Super key mapping: - Key.Meta, Key.LeftMeta, Key.RightMeta as aliases - Cross-platform behavior (Command/Windows/Meta) - Update TIPS.md example to use Key.LeftSuper
1 parent 96ae80e commit 5ff9ecf

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

TIPS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ await hide()
294294
// but you can import that package directly (or another similar package) if you prefer
295295
let info = await getActiveAppInfo()
296296
if (info.bundleIdentifier === "com.google.Chrome"){
297-
await keyboard.pressKey(Key.Meta, Key.T)
298-
await keyboard.releaseKey(Key.Meta, Key.T)
297+
// Key.Meta, Key.LeftSuper, and Key.RightSuper all map to Command (macOS) / Windows key / Meta (Linux)
298+
await keyboard.pressKey(Key.LeftSuper, Key.T)
299+
await keyboard.releaseKey(Key.LeftSuper, Key.T)
299300
}
300301
```

orientation/keyboard.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ await keyboard.tap(Key.LeftSuper, Key.C)
218218
await keyboard.tap(Key.LeftSuper, Key.V)
219219
```
220220
221+
### Modifier Key Aliases
222+
223+
The "super" key maps to different physical keys across platforms:
224+
- **macOS**: Command key
225+
- **Windows**: Windows key
226+
- **Linux**: Meta/Super key
227+
228+
Available Key enum values for this:
229+
- `Key.LeftSuper` / `Key.RightSuper` - Original names
230+
- `Key.Meta` / `Key.LeftMeta` / `Key.RightMeta` - Aliases for discoverability
231+
232+
All of these map to `'command'` which robotjs uses cross-platform.
233+
221234
### Advanced Key Control
222235
```typescript
223236
// Hold shift while typing

0 commit comments

Comments
 (0)