anbox-platform-sdk  1.22.0
Anbox Platform SDK API documentation
anbox::InputProcessor Class Referenceabstract

InputProcessor allows a plugin to propagate input events to Anbox which will forward them to the Android container and influence behavior of input device in Android. More...

#include <input_processor.h>

+ Collaboration diagram for anbox::InputProcessor:

Public Member Functions

 InputProcessor ()=default
 
virtual ~InputProcessor ()=default
 
 InputProcessor (const InputProcessor &)=delete
 
InputProcessoroperator= (const InputProcessor &)=delete
 
virtual int read_event (AnboxInputEvent *event, int timeout)=0
 Read next available input event. More...
 
virtual int inject_event (AnboxInputEvent event)=0
 Inject an input event into AnboxPlatform. More...
 

Detailed Description

InputProcessor allows a plugin to propagate input events to Anbox which will forward them to the Android container and influence behavior of input device in Android.

Definition at line 30 of file input_processor.h.

Constructor & Destructor Documentation

◆ InputProcessor() [1/2]

anbox::InputProcessor::InputProcessor ( )
default

◆ ~InputProcessor()

virtual anbox::InputProcessor::~InputProcessor ( )
virtualdefault

◆ InputProcessor() [2/2]

anbox::InputProcessor::InputProcessor ( const InputProcessor )
delete

Member Function Documentation

◆ inject_event()

virtual int anbox::InputProcessor::inject_event ( AnboxInputEvent  event)
pure virtual

Inject an input event into AnboxPlatform.

This function allows injecting an InputEvent into the platform and letting the InputProcessor handle the input events.

Parameters
eventan event to be pushed into the internal queue.
Returns
0 on success, otherwise returns EINVAL on error occurs.
Note
This function is only used in our test suite to facilitate our automation tests and it is subject to change at any time.

◆ operator=()

InputProcessor& anbox::InputProcessor::operator= ( const InputProcessor )
delete

◆ read_event()

virtual int anbox::InputProcessor::read_event ( AnboxInputEvent event,
int  timeout 
)
pure virtual

Read next available input event.

Anbox will call read_event() to query the plugin for the next available input event which is then forwarded to the Android container. If no input event is available and timeout is set to -1, the function must block until the next event is available.

Parameters
eventPointer to the available event to be sent to the anbox container.
timeoutmaximum number of milliseconds to wait for the next available event. The following possible values for timeout must be handled:
timeout Behavior
0 Non-blocking mode; return -EIO immediately if no event to process.
< 0 Block indefinitely until an event is available.
> 0 Wait up to a maximum of timeout milliseconds for an event.
Returns
0 on success otherwise returns EINVAL on error occurs.

The documentation for this class was generated from the following file: