From 6effca7b61e87c7d17885d007d94e556a0137651 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Wed, 17 Jul 2019 17:12:20 -0400 Subject: ipc: add an input event This adds an ipc event related to input devices. Currently the following changes are supported: - added: when an input device becomes available - removed: when an input device is no longer available - xkb_keymap_changed: (keyboards only) the keymap changed - xkb_layout_changed: (keyboards only) the effective layout changed --- sway/sway-ipc.7.scd | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'sway/sway-ipc.7.scd') diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd index 3657dcd6..4688e46d 100644 --- a/sway/sway-ipc.7.scd +++ b/sway/sway-ipc.7.scd @@ -1371,6 +1371,9 @@ available: |- 0x80000014 : bar_status_update : Send when the visibility of a bar should change due to a modifier +|- 0x80000015 +: input +: Sent when something related to input devices changes ## 0x80000000. WORKSPACE @@ -1702,6 +1705,56 @@ event is a single object with the following properties: } ``` +## 0x80000015. INPUT + +Sent when something related to the input devices changes. The event is a single +object with the following properties: + +[- *PROPERTY* +:- *DATA TYPE* +:- *DESCRIPTION* +|- change +: string +:[ What has changed +|- input +: object +: An object representing the input that is identical the ones GET_INPUTS gives + +The following change types are currently available: +[- *TYPE* +:- *DESCRIPTION* +|- added +:[ The input device became available +|- removed +: The input device is no longer available +|- xkb_keymap +: (Keyboards only) The keymap for the keyboard has changed +|- xkb_layout +: (Keyboards only) The effective layout in the keymap has changed + +*Example Event:* +``` +{ + "change": "xkb_layout", + "input": { + "identifier": "1:1:AT_Translated_Set_2_keyboard", + "name": "AT Translated Set 2 keyboard", + "vendor": 1, + "product": 1, + "type": "keyboard", + "xkb_layout_names": [ + "English (US)", + "English (Dvorak)" + ], + "xkb_active_layout_index": 1, + "xkb_active_layout_name": "English (Dvorak)", + "libinput": { + "send_events": "enabled" + } + } +} +``` + # SEE ALSO *sway*(1) *sway*(5) *sway-bar*(5) *swaymsg*(1) *sway-input*(5) *sway-output*(5) -- cgit v1.2.3-54-g00ecf