Optional
options: TypedEventListenerOptionsGet an HTMLTextAreaElement that communicates text to the active Lens.
Send text to the active Lens. Also updates the provided HTMLTextAreaElement.
String to render. This can include escape sequences, such as the newline character ( \n ) for multi-line input.
Clears the provided HTMLTextAreaElement, and emits the "active" event with active == false
, allowing the
application to e.g. remove relevant text input elements from the DOM.
cameraKitSession.keyboard.addEventListener('active', ({ detail }) => {
const { element, active } = detail
if (active) document.body.appendChild(element)
else element.remove()
})
Generated using TypeDoc
Keyboard is an API enabling lenses to consume and render user-generated text.
Applications that wish to use lenses that expect user-generated text will need to use this API to integrate text input into their user experience.
There are two ways to do this:
Lenses will also signal to the application when text input is expected -- applications should add an event listener and ensure the user is able to input text when the
active
event is received.