Druid-Extension/api/components/base/back_handler_api.md
2025-04-15 21:49:22 +03:00

906 B

druid.back_handler API

at /druid/base/back_handler.lua

Component to handle back button. It handles Android back button and Backspace key.

Setup

Create back handler component with druid: druid:new_back_handler(callback)

Notes

  • Key triggers in input.binding should be setup for correct working
  • It uses a key_back and key_backspace action ids

Functions

Fields

init


back_handler:init([callback], [params])

The Back Handler constructor

  • Parameters:
    • [callback] (function|nil): The callback to call when the back handler is triggered
    • [params] (any): Custom args to pass in the callback

Fields

  • on_back (event): Trigger on back handler action, fun(self, params)

  • params (any): Custom args to pass in the callback