# Interface WaylandTextInput

All Superinterfaces:
  `AutoCloseable, Closeable`

public sealed interface WaylandTextInput extends Closeable
Abstraction layer between Wayland text input protocols.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static interface`
`WaylandTextInput.IMEListener`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Destroy the `WaylandTextInput` instance, making further use of it no longer valid.
`void`
`disableTextInput()`
Disable text input, hiding the text editor surface if applicable (how exactly this shows up in practice depends on the used input method and wayland compositor - in other words, it is highly system-specific).
`void`
`enableTextInput(int cursorX, int cursorY, int width, int height)`
Enable text input, showing the text editor surface if applicable (how exactly this shows up in practice depends on the used input method and wayland compositor - in other words, it is highly system-specific).
`void`
`setCallback(@NotNull WaylandTextInput.IMEListener listener)`
Set the current callback of this `WaylandTextInput` instance.

## Method Details

### close

void close()
Destroy the `WaylandTextInput` instance, making further use of it no longer valid.

This method should only be called on application shutdown, as there is no way to obtain another instance of `WaylandTextInput`.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`

### disableTextInput

void disableTextInput()
Disable text input, hiding the text editor surface if applicable (how exactly this shows up in practice depends on the used input method and wayland compositor - in other words, it is highly system-specific).

### enableTextInput

void enableTextInput(int cursorX, int cursorY, int width, int height)
Enable text input, showing the text editor surface if applicable (how exactly this shows up in practice depends on the used input method and wayland compositor - in other words, it is highly system-specific).

The cursor location is used to smartly choose the location of text input aids.

This method commits the text input state to the wayland compositor.

Parameters:
  `cursorX` - The X-coordinate of the cursor in surface coordinates.
  `cursorY` - The Y-coordinate of the cursor in surface coordinates.
  `width` - The width of the cursor.
  `height` - The height of the cursor.

### setCallback

void setCallback(@NotNull @NotNull WaylandTextInput.IMEListener listener)
Set the current callback of this `WaylandTextInput` instance.

Parameters:
  `listener` - The callback to register. Note: some events might not get called depending on the underlying protocol used.