[][src]Function input_sys::libinput_tablet_tool_get_serial

pub unsafe extern "C" fn libinput_tablet_tool_get_serial(
    tool: *mut libinput_tablet_tool
) -> u64

@ingroup event_tablet

Return the serial number of a tool. If the tool does not report a serial number, this function returns zero.

Some tools provide hardware information that enables libinput to uniquely identify the physical device. For example, tools compatible with the Wacom Intuos 4, Intuos 5, Intuos Pro and Cintiq series are uniquely identifiable through a serial number. libinput does not specify how a tool can be identified uniquely, a caller should use libinput_tablet_tool_is_unique() to check if the tool is unique.

libinput creates a struct @ref libinput_tablet_tool on the first proximity in of this tool. By default, this struct is destroyed on proximity out and re-initialized on the next proximity in. If a caller keeps a reference to the tool by using libinput_tablet_tool_ref() libinput re-uses this struct whenever that same physical tool comes into proximity on any tablet recognized by libinput. It is possible to attach tool-specific virtual state to the tool. For example, a graphics program such as the GIMP may assign a specific color to each tool, allowing the artist to use the tools like physical pens of different color. In multi-tablet setups it is also possible to track the tool across devices.

If the tool does not have a unique identifier, libinput creates a single struct @ref libinput_tablet_tool per tool type on each tablet the tool is used on.

@param tool The libinput tool @return The tool serial number

@see libinput_tablet_tool_is_unique

@since 1.2