to.set_notification_message

set_notification_message sets or remove the notification message.

set-notification-message@2x.png

Examples

Show the notification message while you press right shift key.

{
    "description": "Show a message while right_shift is pressed",
    "manipulators": [
        {
            "type": "basic",
            "from": {
                "key_code": "right_shift",
                "modifiers": {
                    "optional": ["any"]
                }
            },
            "to": [
                {
                    // Show the notification message
                    "set_notification_message": {
                        "id": "my_message",
                        "text": "Hello World!"
                    }
                },
                {
                    "key_code": "right_shift"
                }
            ],
            "to_after_key_up": [
                {
                    // Hide the notification message
                    "set_notification_message": {
                        "id": "my_message",
                        "text": ""
                    }
                }
            ]
        }
    ]
}

Specification

{
    "to": [
        {
            "set_notification_message": {
                "id": "identifier of the message",
                "text": "message text",
                "duration_milliseconds": 3000
            }
        }
    ]
}
NameRequiredDescription
id Required A unique identifier for the notification message.
text Required The notification message to display.
duration_milliseconds Optional If specified, the notification message is dismissed after the specified number of milliseconds.
(Available since Karabiner-Elements 16.1.18)
Last modified: 2026-08-12 Markdown