Program Listing for File input_device_state_event.h¶
↰ Return to documentation for file (/home/docs/checkouts/readthedocs.org/user_builds/canonical-mir-documentation/checkouts/2.26/include/common/mir_toolkit/events/input_device_state_event.h)
/*
* Copyright © Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 2 or 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MIR_TOOLKIT_EVENTS_INPUT_DEVICE_STATE_EVENT_H_
#define MIR_TOOLKIT_EVENTS_INPUT_DEVICE_STATE_EVENT_H_
#include <mir_toolkit/events/event.h>
#include <mir_toolkit/mir_input_device_types.h>
#ifdef __cplusplus
extern "C" {
#endif
MirPointerButtons mir_input_device_state_event_pointer_buttons(
MirInputDeviceStateEvent const* ev);
float mir_input_device_state_event_pointer_axis(
MirInputDeviceStateEvent const* ev, MirPointerAxis axis);
int64_t mir_input_device_state_event_time(
MirInputDeviceStateEvent const* ev);
MirInputEventModifiers mir_input_device_state_event_modifiers(
MirInputDeviceStateEvent const* ev);
uint32_t mir_input_device_state_event_device_count(
MirInputDeviceStateEvent const* ev);
MirInputDeviceId mir_input_device_state_event_device_id(
MirInputDeviceStateEvent const* ev, uint32_t index);
/*
* Retrieve a pressed key on the device identified by the \a index.
* The key is encoded as a scan code.
*
* \param[in] ev The input device state event
* \param[in] index The index of the input device
* \param[in] pressed_index The index of the pressed key
* \return The pressed key at index pressed_index
*/
uint32_t mir_input_device_state_event_device_pressed_keys_for_index(
MirInputDeviceStateEvent const* ev, uint32_t index, uint32_t pressed_index);
uint32_t mir_input_device_state_event_device_pressed_keys_count(
MirInputDeviceStateEvent const* ev, uint32_t index);
MirPointerButtons mir_input_device_state_event_device_pointer_buttons(
MirInputDeviceStateEvent const* ev, uint32_t index);
#ifdef __cplusplus
}
#endif
#endif /* MIR_TOOLKIT_EVENTS_INPUT_DEVICE_STATE_EVENT_H_ */