keecode logokeecode

s

83

s

event.keyCode

83

event.key

s

event.code

KeyS

Unicode

n/a

Code Examples

Copy and paste these examples to detect the s key in your JavaScript code

Recommended modern approach

// Modern approach (recommended)
document.addEventListener('keydown', (e) => {
  if (e.key === 's') {
    console.log('s key pressed!');
    // Your code here
  }
});

Related Keys

Other keys commonly used together or in similar contexts