키 Code Reference

Free online keyboard key code viewer. Real-time keydown/keyup listener showing keyCode, charCode, code, key. Supports combo keys. Pure JS implementation.

按任意键 (A-Z, 0-9, F1-F12, 方向键, 功能键...)

            

사용법

매개변수 및 제한

  • See the input fields on the tool page for parameters

활용 사례

  • Pure frontend processing, results displayed in the browser

Runtime

  • Pure frontend; Agents see API example below

나이nt API 사용법

// Step 1: 读取工具 Schema
GET https://clawam.com/tools/keycode/schema.json

// Step 2: 在浏览器中执行工具逻辑
// 键盘按键码 在工具页 JS 中实现
' + last.location + '0=标准 1=左 2=右 3=数字键盘'; html += '__BLOCK_7__' + last.code + '位置+键名'; } html += ''; display.innerHTML = html; var mods = []; if (keysPressed['Control']) mods.push('Ctrl'); if (keysPressed['Shift']) mods.push('Shift'); if (keysPressed['Alt']) mods.push('Alt'); if (keysPressed['Meta']) mods.push('Meta'); if (mods.length > 0 && last) { extra.style.display = 'flex'; combo.innerHTML = mods.join(' + ') + ' + ' + last.key; } else if (last) { extra.style.display = 'flex'; combo.innerHTML = last.key; } } document.addEventListener('keydown', function(e) { keysPressed[e.key] = { key: e.key, code: e.code, keyCode: e.keyCode, charCode: e.charCode || 0, location: e.location }; refresh(); }); document.addEventListener('keyup', function(e) { delete keysPressed[e.key]; refresh(); }); display.addEventListener('click', function() { display.focus(); }); })();