# Interface LinuxFFMKeys.LinuxKeyCallback

Enclosing class:
  `LinuxFFMKeys`

public static interface LinuxFFMKeys.LinuxKeyCallback
Linux keyboard callback event listener.

## Method Summary

Modifier and Type
Method
Description
`void`
`onFocusGain(int[] pressedEvcodes)`
Event that is called to indicate that keyboard key events may get captured from now on.
`void`
`onFocusLoss()`
Notify that the wayland surface no longer has keyboard focus and as such key events do not get called.
`void`
`onPress(int evcode)`
Event that is fired whenever a key is being depressed/held down.
`void`
`onRelease(int evcode)`
Event that is fired whenever a key has been released.

## Method Details

### onFocusGain

void onFocusGain(int[] pressedEvcodes)
Event that is called to indicate that keyboard key events may get captured from now on.

Note: The internal keyboard state used by `LinuxFFMKeys.getKeyName(int, Arena, Keysym)` will only be updated after this method has been called as the keyboard modifiers are determined using another wayland event.

Parameters:
  `pressedEvcodes` - The currently depressed evdev keycodes

### onFocusLoss

void onFocusLoss()
Notify that the wayland surface no longer has keyboard focus and as such key events do not get called. This especially is critical for currently depressed keys, as the application will not be notified when a key is being released.

Use `onFocusGain(int[])` to obtain information on which keys have been released between focus loss and focus gain. However, the time at which the keys have been released cannot be determined. Neither can it be determined whether the keys have been released and then depressed again in between loss and gain.

Further, the internal keyboard state used by `LinuxFFMKeys.getKeyName(int, Arena, Keysym)` will not be updated between focus loss and focus gain. It will only be restored shortly after the `onFocusGain(int[])` method is called.

### onPress

void onPress(int evcode)
Event that is fired whenever a key is being depressed/held down.

Parameters:
  `evcode` - The evdev keycode of the current pressed key.

### onRelease

void onRelease(int evcode)
Event that is fired whenever a key has been released.

Parameters:
  `evcode` - The evdev keycode of the released key.