Skip to content

Input Sources

The G2 glasses, optional R1 ring, and IMU sensors each provide distinct input:

SourceGestures / DataNotes
G2 touchpads (temple)Press, double press, swipe up, swipe downPrimary input on the glasses frame
R1 touchpads (ring)Press, double press, swipe up, swipe downSame gesture set as G2, but events are distinguishable by source
IMU (accelerometer / gyroscope)Head orientation, motion dataAvailable for motion-aware apps — see IMU API

G2 and R1 touchpad events share the same event types but can now be distinguished by their input source, allowing apps to assign different behaviors to glasses vs. ring input.

Event Types

EventValueDescription
CLICK_EVENT0Single press (G2 or R1)
SCROLL_TOP_EVENT1Swipe up / scroll reaches top boundary
SCROLL_BOTTOM_EVENT2Swipe down / scroll reaches bottom boundary
DOUBLE_CLICK_EVENT3Double press (G2 or R1)
FOREGROUND_ENTER_EVENT4App comes to foreground
FOREGROUND_EXIT_EVENT5App goes to background
ABNORMAL_EXIT_EVENT6Unexpected disconnect

Handling Events

typescript
bridge.onEvenHubEvent(event => {
  const textEvent = event.textEvent
  if (textEvent) {
    const eventType = textEvent.eventType

    switch (eventType) {
      case OsEventTypeList.CLICK_EVENT:
      case undefined: // SDK normalizes 0 to undefined in some cases
        // Handle press
        break
      case OsEventTypeList.DOUBLE_CLICK_EVENT:
        // Handle double press
        break
      case OsEventTypeList.SCROLL_TOP_EVENT:
        // Handle swipe up / scroll up
        break
      case OsEventTypeList.SCROLL_BOTTOM_EVENT:
        // Handle swipe down / scroll down
        break
    }
  }
})

Event Routing

Event delivery depends on which container has isEventCapture: 1:

Capture container typeEvents arrive as
Text containerevent.textEvent
List containerevent.listEvent

Only one container per page can capture events. Design your interaction model around a single active input target.

Lifecycle Events

Your app receives lifecycle events when its visibility changes:

  • FOREGROUND_ENTER_EVENT — the user has opened or returned to your app. Use this to resume updates or refresh data.
  • FOREGROUND_EXIT_EVENT — your app has moved to the background. Pause any timers or ongoing work.
  • ABNORMAL_EXIT_EVENT — the Bluetooth connection was lost unexpectedly.