| 
    Zephyr Project API
    3.4.0
    
   A Scalable Open Source RTOS 
   | 
 
Input Interface. More...
Modules | |
| Input Event Definitions | |
Data Structures | |
| struct | input_event | 
| Input event structure.  More... | |
| struct | input_listener | 
| Input listener callback structure.  More... | |
Macros | |
| #define | INPUT_LISTENER_CB_DEFINE(_dev, _callback) | 
| Register a callback structure for input events.  More... | |
Functions | |
| int | input_report (const struct device *dev, uint8_t type, uint16_t code, int32_t value, bool sync, k_timeout_t timeout) | 
| Report a new input event.  More... | |
| static int | input_report_key (const struct device *dev, uint16_t code, int32_t value, bool sync, k_timeout_t timeout) | 
| Report a new INPUT_EV_KEY input event, note that value is converted to either 0 or 1.  More... | |
| static int | input_report_rel (const struct device *dev, uint16_t code, int32_t value, bool sync, k_timeout_t timeout) | 
| Report a new INPUT_EV_REL input event.  More... | |
| static int | input_report_abs (const struct device *dev, uint16_t code, int32_t value, bool sync, k_timeout_t timeout) | 
| Report a new INPUT_EV_ABS input event.  More... | |
| bool | input_queue_empty (void) | 
| Returns true if the input queue is empty.  More... | |
Input Interface.
| #define INPUT_LISTENER_CB_DEFINE | ( | _dev, | |
| _callback | |||
| ) | 
#include <include/zephyr/input/input.h>
Register a callback structure for input events.
The _dev field can be used to only invoke callback for events generated by a specific device. Setting dev to NULL causes callback to be invoked for every event.
| _dev | device pointer or NULL. | 
| _callback | The callback function. | 
| bool input_queue_empty | ( | void | ) | 
#include <include/zephyr/input/input.h>
Returns true if the input queue is empty.
This can be used to batch input event processing until the whole queue has been emptied. Always returns true if  CONFIG_INPUT_MODE_SYNCHRONOUS   is enabled. 
| int input_report | ( | const struct device * | dev, | 
| uint8_t | type, | ||
| uint16_t | code, | ||
| int32_t | value, | ||
| bool | sync, | ||
| k_timeout_t | timeout | ||
| ) | 
#include <include/zephyr/input/input.h>
Report a new input event.
This causes all the listeners for the specified device to be triggered, either synchronously or through the input thread if utilized.
| dev | Device generating the event or NULL. | 
| type | Event type (see INPUT_EV_CODES). | 
| code | Event code (see INPUT_KEY_CODES, INPUT_BTN_CODES, INPUT_ABS_CODES, INPUT_REL_CODES, INPUT_MSC_CODES). | 
| value | Event value. | 
| sync | Set the synchronization bit for the event. | 
| timeout | Timeout for reporting the event, ignored if  CONFIG_INPUT_MODE_SYNCHRONOUS   is used.  | 
| 0 | if the message has been processed. | 
| negative | if  CONFIG_INPUT_MODE_THREAD   is enabled and the message failed to be enqueued.  | 
      
  | 
  inlinestatic | 
#include <include/zephyr/input/input.h>
Report a new INPUT_EV_ABS input event.
      
  | 
  inlinestatic | 
#include <include/zephyr/input/input.h>
Report a new INPUT_EV_KEY input event, note that value is converted to either 0 or 1.
      
  | 
  inlinestatic | 
#include <include/zephyr/input/input.h>
Report a new INPUT_EV_REL input event.