KeyboardConfiguration
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.
animation_curve_curve
#
animation_curve_curve: bool = True
Curve of the curved portion of the animation occuring after key down and key up events.
animation_curve_duration
#
animation_curve_duration: DurationValue = field(
default_factory=lambda: Duration(milliseconds=450)
)
Duration of the curved ([Curve.EASE_IN
][flet.Curve.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
#
animation_curve_reverse_duration: DurationValue | None = (
field(
default_factory=lambda: Duration(milliseconds=600)
)
)
Duration of the curved (reverse [Curve.EASE_IN
][flet.Curve.EASE_IN])
portion of the animation occuring after a key up event.
Set to None
to use animation_curve_duration
.
autofocus
#
autofocus: bool = True
Whether to request focus as soon as the map control appears (and to enable keyboard controls).
enable_arrow_keys_panning
#
enable_arrow_keys_panning: bool = True
Whether to allow arrow keys to pan the map (in their respective directions).
enable_qe_rotating
#
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
#
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
#
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
#
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
#
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
#
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
#
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
.
This may cause the pan velocity to exceed [max_pan_velocity
][flet_map.types.KeyboardConfiguration.max_pan_velocity].
perform_leap_trigger_duration
#
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
#
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
#
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
.
disabled
#
disabled() -> KeyboardConfiguration
Disable keyboard control of the map.
Info
CursorKeyboardRotationConfiguration
may still be active,
and is not disabled if this is disabled.