CoderTools

Keyboard & Mouse Tester

Test input devices and monitor keyboard/mouse events in real-time

Event Log

No events recorded yet. Press a key or click the mouse to start.

Hover over this area to enable key blocking mode

Visual Keyboard

Press any key to test. Keys will light up when pressed.

Key Information

Key

-

Code

-

KeyCode

-

Location

-

Repeat

-

Modifiers

-

Ghosting Test

Hold multiple keys to test N-key rollover (NKRO)

Keys Held

0

Max Keys Held

0

Recently Pressed Keys

How to Use

This tool helps you test keyboards and mice, and monitor input events in real-time. It's especially useful for developers debugging event handling code, and users checking if their input devices work correctly.

Keyboard Testing

The visual keyboard shows which keys you're pressing in real-time. Test all keys including function keys, modifiers, and special keys. The key information panel shows technical details like key code and scan code.

Mouse Testing

Test all mouse buttons (left, middle, right, back, forward), scroll wheel, and track precise cursor coordinates. Note: Due to browser limitations, back/forward button events fire on release rather than press.

Event Log for Developers

The event log captures all keyboard and mouse events with precise timestamps. You can see the exact sequence of mousedown, mouseup, click events, or keydown, keypress, keyup sequences. Filter events by type and export logs for analysis.

Understanding Coordinate Systems

Mouse positions are reported in multiple coordinate systems:

  • clientX/Y - Position relative to the browser viewport (visible area)
  • pageX/Y - Position relative to the entire document (includes scroll offset)
  • screenX/Y - Position relative to the monitor screen
  • offsetX/Y - Position relative to the target element
  • movementX/Y - Relative movement since last event (useful for drag operations)

Ghosting & N-Key Rollover

Ghosting occurs when some key combinations don't register on certain keyboards. This tool helps you detect how many keys your keyboard can handle simultaneously (N-key rollover). Gaming keyboards typically support full NKRO.

Double-Click Detection

Test double-clicks for ALL mouse buttons (left, middle, right, back, forward) with customizable delay threshold (100-2000ms). Helps detect faulty switches causing unintended double-clicks. Adjust the delay setting to match your clicking speed.

Tips

  • Some keys like F1-F12 may be intercepted by the browser or OS. Try pressing Fn key if available.
  • The event log is useful for debugging JavaScript input handling code.
  • Use the coordinate systems panel to understand how different position values work.
  • Export event logs to analyze input timing and event sequences.
  • The visual keyboard supports both ANSI (US) and ISO (EU) layouts.

Frequently Asked Questions

Why does my keyboard not respond to certain key combinations?

This is called keyboard ghosting or key blocking. Many budget keyboards use a matrix circuit design that physically cannot register more than 2-3 simultaneous key presses in certain combinations. Gaming keyboards marketed as “N-key rollover” (NKRO) use individual circuits per key and can detect all keys pressed at once. You can test your keyboard’s rollover limit right here by pressing multiple keys simultaneously and watching which ones register.

What is the difference between keydown, keypress, and keyup events?

These are three browser keyboard events that fire in sequence. keydown fires the instant a key is physically pressed and repeats if the key is held. keypress fired for printable characters (now deprecated in favor of keydown). keyup fires when the key is released. For most web applications, keydown is the recommended handler because it captures all keys including Shift, Ctrl, and arrow keys, while keypress only fired for character keys.

How is DPI different from polling rate for a mouse?

DPI (dots per inch) measures how far the on-screen cursor moves per inch of physical mouse movement — higher DPI means more sensitivity. Polling rate (measured in Hz) is how often the mouse reports its position to the computer per second; 1000 Hz means the position is updated every 1 ms. DPI affects precision, while polling rate affects smoothness and input lag. Most gaming mice allow you to adjust both independently.

What do clientX/clientY and pageX/pageY coordinates mean?

Mouse events produce multiple coordinate pairs measured from different reference points. clientX/clientY are the coordinates relative to the visible viewport — they reset to zero at the top-left corner of what you can see, regardless of how far you’ve scrolled. pageX/pageY are relative to the entire page document, so they increase as you scroll down. screenX/screenY refer to the physical monitor. For most UI interactions, clientX/clientY is what you want.

Why does my scroll wheel stop working inside a text area or a scrollable container?

This is expected browser behavior called scroll event bubbling. When your cursor is over a scrollable element (like a textarea or an overflow:scroll div), the browser sends scroll events to that element first. Only when that inner element has no more scroll room does the event “bubble up” to the outer page. In this testing tool, place the cursor outside any scrollable panel to capture page-level scroll events in the event log.

What are keyboard locations?

Location indicates where a key is on the keyboard: Standard (0) for most keys, Left (1) for left-side modifiers, Right (2) for right-side modifiers, and Numpad (3) for numeric keypad keys.

Why do back/forward buttons respond on release?

Browsers delay back/forward button events to support native navigation. The tool shows visual feedback for 200ms to ensure visibility. This is a browser limitation, not a device issue.

Quick Menu

No recent tools