Skip to content

feat: add custom format-icons for each key in keyboard-state module#4883

Open
Cprakhar wants to merge 2 commits intoAlexays:masterfrom
Cprakhar:feat/custom-format-icons-keyboard
Open

feat: add custom format-icons for each key in keyboard-state module#4883
Cprakhar wants to merge 2 commits intoAlexays:masterfrom
Cprakhar:feat/custom-format-icons-keyboard

Conversation

@Cprakhar
Copy link
Copy Markdown
Contributor

Description

This PR adds new options to specify icons for different keys (e.g., "numlock", "scrolllock", "capslock").
Closes: #4848

Example:

"keyboard-state": {
        "format": "{name} {icon}",
        "format-icons": {
            "capslock": {
                "locked": "CL",
                "unlocked": "cl"
            },
            "numlock": {
                "locked": "NL",
                "unlocked": "nl"
            },
            "scrolllock": {
                "locked": "SL",
                "unlocked": "sl"
            }
        },
        "numlock": true,
        "scrolllock": true,
        "capslock": true
    }

Capslock: OFF
image
Capslock: ON
image

It is backward-compatible; if locked or unlocked is defined as below, then it uses the same icons for all keys.

"keyboard-state": {
        "format": "{name} {icon}",
        "format-icons": {
           "locked": "",
           "unlocked": ""
        },
        "numlock": true,
        "scrolllock": true,
        "capslock": true
    }

@Cprakhar Cprakhar force-pushed the feat/custom-format-icons-keyboard branch from 25850d8 to a64876b Compare February 24, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keyboard-state should allow for a more granular configuration of display format

1 participant