Skip to content

KeyboardConfiguration

Options to configure how keyboard keys may be used to control the map. When a key is pushed down, an animation starts, consisting of a curved portion which takes the animation to its maximum velocity, an indefinitely long animation at maximum velocity, then ended on the key up with another curved portion.

If a key is pressed and released quickly, it might trigger a short animation called a 'leap'. The leap consists of a part of the curved portion, and also scales the velocity of the concerned gesture.

Info

See CursorKeyboardRotationConfiguration for options to control the keyboard and mouse cursor being used together to rotate the map.

Properties

Methods

  • disabled

    Disable keyboard control of the map.

Properties#

animation_curve_curve class-attribute instance-attribute #

animation_curve_curve: AnimationCurve = EASE_IN_OUT

Curve of the curved portion of the animation occuring after key down and key up events.

animation_curve_duration class-attribute instance-attribute #

animation_curve_duration: DurationValue = field(
    default_factory=lambda: Duration(milliseconds=450)
)

Duration of the curved (AnimationCurve.EASE_IN) portion of the animation occuring after a key down event (and after a key up event if animation_curve_reverse_duration is None)

animation_curve_reverse_duration class-attribute instance-attribute #

animation_curve_reverse_duration: DurationValue | None = (
    field(
        default_factory=lambda: Duration(milliseconds=600)
    )
)

Duration of the curved (reverse AnimationCurve.EASE_IN) portion of the animation occuring after a key up event.

Set to None to use animation_curve_duration.

autofocus class-attribute instance-attribute #

autofocus: bool = True

Whether to request focus as soon as the map control appears (and to enable keyboard controls).

enable_arrow_keys_panning class-attribute instance-attribute #

enable_arrow_keys_panning: bool = True

Whether to allow arrow keys to pan the map (in their respective directions).

enable_qe_rotating class-attribute instance-attribute #

enable_qe_rotating: bool = True

Whether to allow the Q & E keys (*) to rotate the map (Q rotates anticlockwise, E rotates clockwise).

QE are only the physical and logical keys on QWERTY keyboards. On non- QWERTY keyboards, such as AZERTY, the keys in the same position as on the QWERTY keyboard is used (ie. AE on AZERTY).

enable_rf_zooming class-attribute instance-attribute #

enable_rf_zooming: bool = True

Whether to allow the R & F keys to zoom the map (R zooms IN (increases zoom level), F zooms OUT (decreases zoom level)).

RF are only the physical and logical keys on QWERTY keyboards. On non- QWERTY keyboards, such as AZERTY, the keys in the same position as on the QWERTY keyboard is used (ie. RF on AZERTY).

enable_wasd_panning class-attribute instance-attribute #

enable_wasd_panning: bool = True

Whether to allow the W, A, S, D keys (*) to pan the map (in the directions UP, LEFT, DOWN, RIGHT respectively).

WASD are only the physical and logical keys on QWERTY keyboards. On non- QWERTY keyboards, such as AZERTY, the keys in the same position as on the QWERTY keyboard is used (ie. ZQSD on AZERTY).

If enabled, it is recommended to enable enable_arrow_keys_panning to provide panning functionality easily for left handed users.

leap_max_of_curve_component class-attribute instance-attribute #

leap_max_of_curve_component: Number = 0.6

The percentage (0.0 - 1.0) of the curve animation component that is driven to (from 0), then in reverse from (to 0).

Reducing means the leap occurs quicker (assuming a consistent curve animation duration). Also see *_leap_velocity_multiplier properties to change the distance of the leap assuming a consistent leap duration.

For example, if set to 1, then the leap will take animation_curve_duration + animation_curve_reverse_duration to complete.

Must be greater than 0 and less than or equal to 1. To disable leaping, or change the maximum length of the key press that will trigger a leap, see perform_leap_trigger_duration.

max_rotate_velocity class-attribute instance-attribute #

max_rotate_velocity: Number = 3

The maximum angular difference to apply per frame to the camera's rotation during a rotation animation.

Measured in degrees. Negative numbers will flip the standard rotation keys.

max_zoom_velocity class-attribute instance-attribute #

max_zoom_velocity: Number = 0.03

The maximum zoom level difference to apply per frame to the camera's zoom level during a zoom animation.

Measured in zoom levels. Negative numbers will flip the standard zoom keys.

pan_leap_velocity_multiplier class-attribute instance-attribute #

pan_leap_velocity_multiplier: Number = 5

The amount to scale the panning offset velocity by during a leap animation.

The larger the number, the larger the movement during a leap. To change the duration of a leap, see leap_max_of_curve_component.

perform_leap_trigger_duration class-attribute instance-attribute #

perform_leap_trigger_duration: DurationValue | None = field(
    default_factory=lambda: Duration(milliseconds=100)
)

Maximum duration between the key down and key up events of an animation which will trigger a 'leap'.

To customize the leap itself, see the leap_max_of_curve_component & *leap_velocity_multiplier (zoom_leap_velocity_multiplier, pan_leap_velocity_multiplier and rotate_leap_velocity_multiplier) properties.

Set to None to disable leaping.

rotate_leap_velocity_multiplier class-attribute instance-attribute #

rotate_leap_velocity_multiplier: Number = 3

The amount to scale the rotation velocity by during a leap animation

The larger the number, the larger the rotation difference during a leap. To change the duration of a leap, see leap_max_of_curve_component.

This may cause the pan velocity to exceed max_rotate_velocity.

zoom_leap_velocity_multiplier class-attribute instance-attribute #

zoom_leap_velocity_multiplier: Number = 3

The amount to scale the zooming velocity by during a leap animation.

The larger the number, the larger the zoom difference during a leap. To change the duration of a leap, see leap_max_of_curve_component.

This may cause the pan velocity to exceed max_zoom_velocity.

Methods#

disabled classmethod #

disabled() -> KeyboardConfiguration

Disable keyboard control of the map.

Info

CursorKeyboardRotationConfiguration may still be active, and is not disabled if this is disabled.