Interaction Methods
  • 19 Dec 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Interaction Methods

  • Dark
    Light

Article summary

The Shield's interaction methods differ significantly from traditional touchscreen Android devices. It is particularly important to keep these considerations in mind when designing the User Interface of an application intended to run on this device. Existing applications which heavily leverage touchscreen interactions do not translate well to the Shield. This is due to the fact that the transitional touchscreen UI is leveraging taps for input based on specific screen coordinates, which is not possible with the Shield’s interaction methods.


Touchpad

The Shield features a two-axis touchpad with single or double-finger tracking gestures for predefined actions. The horizontal swipe gestures can be leveraged for left/right navigation and the vertical swipes can be leveraged for the up/down navigation.

The touchpad is implemented as a trackball device, and methods such as dispatchTrackballEvent() and onTrackballEvent() can be used to capture and process the raw touchpad events.

As a fallback, if you do not handle the trackball events in your application, the touchpad will fire KEYCODE_DPAD events which can be captured with standard Android methods.

Refer Android KeyEvent documentation for details on KEYCODE_DPAD events. https://developer.android.com/reference/android/view/KeyEvent.html.

Note that the Home gesture cannot be intercepted or modified. This is an expected Android behavior.

Available Gestures and Taps:

  • One-Finger Tap = Select when Shield is awake. When Shield is sleeping it turns on the displa

  • One-Finger Swipe Forward = Forward

  • One-Finger Swipe Backward = Back

  • One-Finger Swipe Up = Up

  • One-Finger Swipe Down = Down

  • One-Finger Hold for one second = Activate the app menu(if available), on Keyboard it shows the char's menu

  • Two-Finger Tap = Back or Return.

  • Two-Finger Hold for one second = Home

  • Two-Finger Slide Up = Volume up

  • Two-Finger Slide Down = Volume down

KeyCodes for available taps and gestures:

  • ONE FINGER TAP: Select

    • Key Event Fired: KEYCODE_DPAD_CENTER

  • ONE FINGER HOLD FOR 1 SECOND: Menu

    • Key Event Fired: KEYCODE_MENU

  • ONE FINGER SWIPE LEFT: Menu

    • Key Event Fired: KEYCODE_DPAD_LEFT

  • ONE FINGER SWIPE RIGHT: Menu

    • Key Event Fired: KEYCODE_DPAD_RIGHT

  • ONE FINGER SWIPE UP: Menu

    • Key Event Fired: KEYCODE_DPAD_UP

  • ONE FINGER SWIPE DOWN: Menu

    • Key Event Fired: KEYCODE_DPAD_DOWN

  • TWO FINGER TAP: Back or Return

    • Key Event Fired: KEYCODE_BACK

  • TWO FINGER HOLD: Home

    • Key Event Fired: KEYCODE_HOME

  • TWO FINGER SWIMPE UP: Volume up

    • Key Event Fired: KEYCODE_VOLUME_UP

  • TWO FINGER SWIMPE DOWN: Volume up

    • Key Event Fired: KEYCODE_VOLUME_DOWN


Was this article helpful?