▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/Keyboard Detector
Keyboard Detector

Keyboard Detector

Detect any keypresses to enable more possibilities for key events!!!

459
2

Keyboard Detector Command Guide

Advanced keyboard event detection in Minecraft for all keys!

Command Overview

CommandFunctionalityKey Parameters
iskeydownSingle key press detection<KeyAscii>, <keepStatic>
matchgroupMulti-key combination detection<KeyAsciiList>
iskeytappedInstant Multi-key combination detection<KeyAsciiList>
flushReset key states for subcommand iskeydownNone

1. Single Key Detection: /keyboarddetector iskeydown

Functionality

Detects real-time press state of a specific keyboard key.

Command Syntax

/keyboarddetector iskeydown <PlayerID> <KeyAscii>
ParameterDescriptionExample Values
<PlayerID>Target player selector@p, @a[limit=1], @e[type=player,limit=1]
<KeyAscii>ASCII code of the key to detect49
<keepStatic>Persistent state mode (true/false)true, false

Usage Examples

Standard mode:

/keyboarddetector iskeydown @p 49 false

Detects long-press of key '1'.

Persistent mode:

/keyboarddetector iskeydown @p 49 true

If target player have pressed the '1' key, the command block will return true and activate redstone signal constantly (Until /keyboarddetector flush is executed).

Command Block Behavior

ModeBehavior
Standard Mode (keepStatic=false)• Activates signal when all keys are pressed simultaneously
• Deactivates immediately when any key is released
Persistent Mode (keepStatic=true)• Locks signal on first successful detection.
• Maintains activation after keys are released.
• Requires manual flush to reset

2. Key Combination Detection: /keyboarddetector matchgroup

Functionality

Detects simultaneous pressing of multiple keys. (independent key processing)

Command Syntax

/keyboarddetector matchgroup <PlayerID> <KeyAsciiList> <keepStatic>

Parameters

ParameterDescriptionExample Values
<PlayerID>Target player selector@p, @a[limit=1], @e[type=player,limit=1]
<KeyAscii>Comma-separated ASCII codes49,50,51

Usage Examples

/keyboarddetector matchgroup @p 49,50,51

Detects simultaneous press of keys '1', '2', '3'.

Command Block Behavior

  • In repeating command blocks:
    • 🔴 Key pressed: Returns true and activates redstone signal
    • ⚪ Key released: Returns false and deactivates redstone signal

3.Instant Key Combination Detection: /keyboarddetector iskeytapped

Functionality

Detect solely the instant when the key is pressed for multiple keys. (independent key processing).

Command Syntax

/keyboarddetector iskeytapped <PlayerID> <KeyAsciiList> <keepStatic>

Parameters

ParameterDescriptionExample Values
<PlayerID>Target player selector@p, @a[limit=1], @e[type=player,limit=1]
<KeyAscii>Comma-separated ASCII codes49,50,51

Usage Examples

/keyboarddetector iskeytapped @p 49,50,51

Detects solely the instant when the key '1', '2', '3' are pressed.

Command Block Behavior

  • In repeating command blocks:
    • 🔴 Key pressed: Returns true and activates redstone signal solely the instant when the key is pressed.
    • ⚪ Key hold: Returns false and deactivates redstone signal. (Different from /keyboarddetector matchgroup)
    • ⚪ Key released: Returns false and deactivates redstone signal

4. State Reset Command: /keyboarddetector flush

Functionality

Clears persistent key states created by iskeydown with keepStatic=true

Usage Scenario

  1. Persistent mode activated:
/keyboarddetector iskeydown @p 49 true
  1. After keys are pressed, signal stays active

  2. Reset detection state (must with conditional statement):

/keyboarddetector flush

Effects

♻️ Resets all detection states

🚦 Requires new key combination press to reactivate

Attention

❗ When more than 1 command blocks are exetuting /keyboarddetector matchgroup, make sure all <AsciiList> must not contain any duplicate values. Otherwise, only one of the key events can be triggered.

❗ Do not use /keyboarddetector flush without conditional statement. Otherwise, all subcommands for decection won't be available.

ASCII Key Reference Table

KeyASCII CodeKeyASCII Code
NumbersLetters
048A65
149B66
250C67
351D68
452E69
553F70
654G71
755H72
856I73
957J74
K75
L76
M77
N78
O79
P80
Q81
R82
S83
T84
U85
V86
W87
X88
Y89
Z90
FunctionsSpecial
F1112Space32
F2113Enter13
F3114Esc27
F4115Tab9
F5116Caps Lock20
F6117Shift16
F7118Ctrl17
F8119Alt18
F9120Backspace8
F10121Delete46
F11122Insert45
F12123Home36
End35
Page Up33
Page Down34
Arrow Up38
Arrow Down40
Arrow Left37
Arrow Right39

Notes:

  • Lowercase letters: a=97, b=98 ... z=122
  • Numeric keypad: 0=96, 1=97 ... 9=105
  • Case sensitive (A=65 vs a=97)
  • Full reference: ASCII Table

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Детали

Лицензия:Apache-2.0
Опубликован:8 месяцев назад
Обновлён:7 месяцев назад
Главная