# IInputRoot

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/trait-iinputroot/

**trait** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
trait IInputRoot
```

Defines the interface for top-level input elements: the part of a
presentation source that input is delivered through.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L8)

## Members

- [`focus_manager`](#function-focus_manager)
- [`pointer_over_element`](#function-pointer_over_element)
- [`set_pointer_over_element`](#function-set_pointer_over_element)
- [`cursor_element`](#function-cursor_element)
- [`set_cursor_element`](#function-set_cursor_element)
- [`root_element`](#function-root_element)
- [`try_root_element`](#function-try_root_element)
- [`focus_root`](#function-focus_root)
- [`hit_test_chrome_element`](#function-hit_test_chrome_element)
- [`pointer_over_invalidated`](#function-pointer_over_invalidated)

<a id="function-focus_manager"></a>

### focus_manager

```rust
fn focus_manager(self: &Self) -> Option<Rc<FocusManager>>
```

The focus manager of the root.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L10)

<a id="function-pointer_over_element"></a>

### pointer_over_element

```rust
fn pointer_over_element(self: &Self) -> Option<Ref<InputElement>>
```

The input element that the pointer is currently over.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L13)

<a id="function-set_pointer_over_element"></a>

### set_pointer_over_element

```rust
fn set_pointer_over_element(self: &Self, value: Option<Ref<InputElement>>)
```

Sets the input element that the pointer is currently over.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L16)

<a id="function-cursor_element"></a>

### cursor_element

```rust
fn cursor_element(self: &Self) -> Option<Ref<InputElement>>
```

The element whose cursor is shown.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L19)

<a id="function-set_cursor_element"></a>

### set_cursor_element

```rust
fn set_cursor_element(self: &Self, value: Option<Ref<InputElement>>)
```

Sets the element whose cursor is shown.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L22)

<a id="function-root_element"></a>

### root_element

```rust
fn root_element(self: &Self) -> Ref<InputElement>
```

The root input element.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L33)

<a id="function-try_root_element"></a>

### try_root_element

```rust
fn try_root_element(self: &Self) -> Option<Ref<InputElement>>
```

Deviation (DEVIATIONS.md, Input): the optional form of
`root_element`.

The root input element, or `None` once the root has closed: what the
reference reads as a null `RootElement`, for the code that runs while
an event that closed its root is still being processed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L41)

<a id="function-focus_root"></a>

### focus_root

```rust
fn focus_root(self: &Self) -> Ref<InputElement>
```

The element keyboard input is sent to when nothing is focused.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L46)

<a id="function-hit_test_chrome_element"></a>

### hit_test_chrome_element

```rust
fn hit_test_chrome_element(self: &Self, _point: Point) -> Option<WindowDecorationsElementRole>
```

Performs a hit-test for chrome/decoration elements at the given
position, in root-relative coordinates.

Returns `None` if no chrome element was hit (no chrome involvement
at this point),
`WindowDecorationsElementRole::DecorationsElement` or
`WindowDecorationsElementRole::User` if an interactive chrome
element was hit — the platform should redirect non-client input to
regular client input. Any other value different from
`WindowDecorationsElementRole::None` indicates a specific
non-client role (titlebar, resize grip, etc.).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L59)

<a id="function-pointer_over_invalidated"></a>

### pointer_over_invalidated

```rust
fn pointer_over_invalidated(self: &Self)
```

Called when what is under the pointer may have changed without the
pointer moving, e.g. when the capture of a pointer changes.

The root re-evaluates the pointer-over element. This is a dispatcher
seam: a host should update the pointer-over state from here, either
immediately or posted to its dispatcher.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_input_root.rs#L69)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
