Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
keyboard

3 Articles
{
,

}
Image
Direct link to the article Number Scrubbing
form controls keyboard

Number Scrubbing

If you use <input type="number">, some browsers give you an input that has UI for incrementing the number, like up/down arrows (often called “spinners”).…

Image
Chris Coyier on Aug 28, 2020
Image
Direct link to the article Review of My New Computer Equipment
equipment keyboard mac monitor

Review of My New Computer Equipment

I recently changed out just about all of my computer equipment. Nothing dramatic like #davegoeswindows, but all new gear within my relative comfort-zone. It was the first time since late 2013, and now it’s going on 2017, so I …

Image
Chris Coyier on Dec 28, 2016 Updated on Jan 5, 2017
Image
Direct link to the article KeyboardEvent Value (keyCodes, metaKey, etc)
keyboard

KeyboardEvent Value (keyCodes, metaKey, etc)

When a KeyboardEvent fires, you can test which key was pressed because that event contains information you can write logic against.

document.addEventListener("keydown", function(event) {
  console.log(event.which);
})

For example, by pressing a, you’ll get 65. Apparently it’s best to …

Image
Chris Coyier on Jun 26, 2012 Updated on Sep 22, 2022

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top
Advertisement