Quick answer: Combine Key Is Down (modifier) with On Key Pressed (main key) in one event. Both conditions evaluated together.
A level editor wants Ctrl+S to save. On Key Pressed for S alone fires when you type. Need to additionally require Ctrl held.
Event Setup
On Key Pressed: S
Keyboard.KeyIsDown(Control)
→ SaveLevel
The combined conditions both fire on the same frame; action runs only when both true.
Avoid Default Browser Action
Ctrl+S triggers browser’s Save Page. Suppress via:
System → On start of layout:
Browser → Execute JavaScript: "window.addEventListener('keydown', e => { if (e.ctrlKey && e.key === 's') e.preventDefault(); });"
Prevents browser from intercepting before C3 sees the press.
Multi-Key Combos
Ctrl+Shift+S: chain three conditions. Each Is Down + final On Key Pressed.
Mac Cmd Key
Mac uses Cmd instead of Ctrl. Detect platform:
Browser.UserAgent contains "Mac":
Keyboard.KeyIsDown(Meta) & On Key Pressed S
else:
Keyboard.KeyIsDown(Control) & On Key Pressed S
Verifying
Press S alone: no action. Press Ctrl+S: save triggers. No browser save-page dialog.
“Modifier + main key = AND condition. Use Key Is Down for the modifier, On Key Pressed for the trigger.”
For shipped games, also handle browser’s focus-loss alt-tab + shift behavior — consistent input across devices.