swayfx/include/sway/input/switch.h
Ryan Walklin bdb402404c Support WLR_INPUT_DEVICE_SWITCH in sway
This commit adds support for laptop lid and tablet
mode switches as provided by evdev/libinput and
handled by wlroots.

Adds a new bindswitch command with syntax:
bindswitch <switch>:<state> <command>

Where <switch> is one of:
tablet for WLR_SWITCH_TYPE_TABLET_MODE
lid for WLR_SWITCH_TYPE_LID

<state> is one of:
on for WLR_SWITCH_STATE_ON
off for WLR_SWITCH_STATE_OFF
toggle for WLR_SWITCH_STATE_TOGGLE

(Note that WLR_SWITCH_STATE_TOGGLE doesn't map to
libinput and will trigger at both on and off events)
2019-03-19 23:58:47 -04:00

20 lines
430 B
C

#ifndef _SWAY_INPUT_SWITCH_H
#define _SWAY_INPUT_SWITCH_H
#include "sway/input/seat.h"
struct sway_switch {
struct sway_seat_device *seat_device;
struct wl_listener switch_toggle;
};
struct sway_switch *sway_switch_create(struct sway_seat *seat,
struct sway_seat_device *device);
void sway_switch_configure(struct sway_switch *sway_switch);
void sway_switch_destroy(struct sway_switch *sway_switch);
#endif