ThirdEye Head Motion Gaze UI Controls Documentation

Developer guide
Introduction
Welcome to ThirdEye UI Controls developer guide. By the end of this guide you will know how to listen for actions performed by the UI Controls and implement your own custom logic based on them.
UI Controls was designed in such a way so that you, the third-party developer, have to do as little as possible to integrate its interactions into your app.
That is why everything is managed by functionality already implemented into Android and there is no external library needed.
Depending on the action, there are two ways UI Controls communicates with the Android system and by extension with your app.
- For the clicks performed on the UI Menu’s buttons and for the cursor’s movement and position, UI Controls broadcasts Intents.
- For all the other clicks, you handle the events as you normally would if you developed for any regular Android device.
Intents
UI Controls broadcasts Intents as follows:
Description | Name | Extras |
Cursor movement | thirdeye.uicontrols.action.CURSOR_MOVED | (int) x (int) y |
Home button pressed | thirdeye.uicontrols.action.HOME_PRESSED | |
Back button pressed | thirdeye.uicontrols.action.BACK_PRESSED | |
Scroll up button pressed | thirdeye.uicontrols.action.SCROLLED_UP | |
Scroll down button pressed | thirdeye.uicontrols.action.SCROLLED_DOWN | |
Zoom in button pressed | thirdeye.uicontrols.action.ZOOMED_IN | |
Zoom out button pressed | thirdeye.uicontrols.action.ZOOMED_OUT | |
UI Settings opened | thirdeye.uicontrols.action.UI_SETTINGS_OPENED | |
UI Settings closed | thirdeye.uicontrols.action.UI_SETTINGS_CLOSED | |
Task Manager button pressed | thirdeye.uicontrols.action.TASK_MANAGER_PRESSED | |
UI Menu visible | thirdeye.uicontrols.action.UI_MENU_VISIBLE | |
UI Menu hidden | thirdeye.uicontrols.action.UI_MENU_HIDDEN |
The way to use these follows the Android guidelines for using Broadcasts. For more info on how to use Broadcasts, read here https://developer.android.com/guide/components/broadcasts
IntentFilter filter = new IntentFilter("thirdeye.uicontrols.action.UI_MENU_VISIBLE"); filter.addAction("thirdeye.uicontrols.action.CURSOR_MOVED"); BroadcastReceiver receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("thirdeye.uicontrols.action.UI_MENU_VISIBLE")) { //do something } else if(intent.getAction().equals("thirdeye.uicontrols.action.CURSOR_MOVED")){ int x = intent.getIntExtra("x", 0); int y = intent.getIntExtra("y", 0); //do something more } } }; registerReceiver(receiver, new IntentFilter(filter));
@Override protected void onPause() { super.onPause(); unregisterReceiver(receiver); } @Override protected void onResume() { super.onResume(); registerReceiver(receiver, filter); }