Interface KeyboardService

All Known Implementing Classes:
AndroidKeyboardService, DummyKeyboardService, IOSKeyboardService

public interface KeyboardService
With the keyboard service, you can query the height of the software keyboard, whenever it becomes visible.

Example

 KeyboardService.create().ifPresent(service -> {
      service.visibleHeightProperty().addListener((obs, ov, nv) ->
          System.out.println("height: " + nv));
  });

Android Configuration: none

iOS Configuration: none

Since:
4.0.7
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ReadOnlyFloatProperty
    Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an instance of KeyboardService.
    void
    keepVisibilityForNode(javafx.scene.Node node)
    Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it.
    void
    keepVisibilityForNode(javafx.scene.Node node, javafx.scene.Parent parent)
    Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it
    javafx.beans.property.ReadOnlyFloatProperty
    Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
  • Property Details

    • visibleHeight

      javafx.beans.property.ReadOnlyFloatProperty visibleHeightProperty
      Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
  • Method Details

    • create

      static Optional<KeyboardService> create()
      Returns an instance of KeyboardService.
      Returns:
      An instance of KeyboardService.
    • keepVisibilityForNode

      void keepVisibilityForNode(javafx.scene.Node node)
      Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it. For that, the root parent will be moved accordingly.
      Parameters:
      node - the Node to adjust, so it is always visible
    • keepVisibilityForNode

      void keepVisibilityForNode(javafx.scene.Node node, javafx.scene.Parent parent)
      Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it
      Parameters:
      node - the Node to adjust, so it is always visible
      parent - the Parent of the node that will be moved
    • visibleHeightProperty

      javafx.beans.property.ReadOnlyFloatProperty visibleHeightProperty()
      Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.