Control
17
ctrl
event.keyCode
17
event.key
Control
event.code
ControlLeft
Unicode
^
Code Examples
Copy and paste these examples to detect the Control key in your JavaScript code
Recommended modern approach
// Modern approach (recommended)
document.addEventListener('keydown', (e) => {
if (e.key === 'Control') {
console.log('Control key pressed!');
// Your code here
}
});Common Use Cases
How the Control key is typically used in web applications
Keyboard Shortcuts
Combine with other keys for shortcuts (Ctrl+C, Ctrl+V)
Multi-Select
Select multiple items by holding Control
Text Manipulation
Word-level navigation and selection in text
Related Keys
Other keys commonly used together or in similar contexts