Function input_sys::libinput_device_config_rotation_set_angle [] [src]

pub unsafe extern "C" fn libinput_device_config_rotation_set_angle(
    device: *mut libinput_device,
    degrees_cw: c_uint
) -> libinput_config_status

@ingroup config

Set the rotation of a device in degrees clockwise off the logical neutral position. Any subsequent motion events are adjusted according to the given angle.

The angle has to be in the range of [0, 360[ degrees, otherwise this function returns LIBINPUT_CONFIG_STATUS_INVALID. If the angle is a multiple of 360 or negative, the caller must ensure the correct ranging before calling this function.

libinput guarantees that this function accepts multiples of 90 degrees. If a value is within the [0, 360[ range but not a multiple of 90 degrees, this function may return LIBINPUT_CONFIG_STATUS_INVALID if the underlying device or implementation does not support finer-grained rotation angles.

The rotation angle is applied to all motion events emitted by the device. Thus, rotating the device also changes the angle required or presented by scrolling, gestures, etc.

@param device The device to configure @param degrees_cw The angle in degrees clockwise @return A config status code. Setting a rotation of 0 degrees on a device that does not support rotation always succeeds.

@see libinput_device_config_rotation_is_available @see libinput_device_config_rotation_get_angle @see libinput_device_config_rotation_get_default_angle