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.
See CursorKeyboardRotationConfiguration for options to control the keyboard and mouse cursor being used together to rotate the map.
Properties
animation_curve_curve- Curve of the curved portion of the animation occurring after key down and key up events.animation_curve_duration- Duration of the curved (flet.AnimationCurve.EASE_IN) portion of the animation occurring after a key down event (and after a key up event if animation_curve_reverse_duration isNone)animation_curve_reverse_duration- Duration of the curved (reverse flet.AnimationCurve.EASE_IN) portion of the animation occurring after a key up event.autofocus- Whether to request focus as soon as the map control appears (and to enable keyboard controls).enable_arrow_keys_panning- Whether to allow arrow keys to pan the map (in their respective directions).enable_qe_rotating- Whether to allow theQ&Ekeys (*) to rotate the map (Qrotates anticlockwise,Erotates clockwise).enable_rf_zooming- Whether to allow theR&Fkeys to zoom the map (Rzooms IN (increases zoom level),Fzooms OUT (decreases zoom level)).enable_wasd_panning- Whether to allow theW,A,S,Dkeys (*) to pan the map (in the directions UP, LEFT, DOWN, RIGHT respectively).leap_max_of_curve_component- The percentage (0.0 - 1.0) of the curve animation component that is driven to (from 0), then in reverse from (to 0).max_rotate_velocity- The maximum angular difference to apply per frame to the camera's rotation during a rotation animation.max_zoom_velocity- The maximum zoom level difference to apply per frame to the camera's zoom level during a zoom animation.pan_leap_velocity_multiplier- The amount to scale the panning offset velocity by during a leap animation.perform_leap_trigger_duration- Maximum duration between the key down and key up events of an animation which will trigger a 'leap'.rotate_leap_velocity_multiplier- The amount to scale the rotation velocity by during a leap animationzoom_leap_velocity_multiplier- The amount to scale the zooming velocity by during a leap animation.
Methods
disabled- Disable keyboard control of the map.
Properties
animation_curve_curveclass-attributeinstance-attribute
animation_curve_curve: AnimationCurve = AnimationCurve.EASE_IN_OUTCurve of the curved portion of the animation occurring after key down and key up events.
animation_curve_durationclass-attributeinstance-attribute
animation_curve_duration: DurationValue = field(default_factory=(lambda: Duration(milliseconds=450)))Duration of the curved (flet.AnimationCurve.EASE_IN)
portion of the animation occurring
after a key down event (and after a key up event if
animation_curve_reverse_duration is None)
animation_curve_reverse_durationclass-attributeinstance-attribute
animation_curve_reverse_duration: Optional[DurationValue] = field(default_factory=(lambda: Duration(milliseconds=600)))Duration of the curved (reverse flet.AnimationCurve.EASE_IN) portion of the animation occurring after a key up event.
Set to None to use animation_curve_duration.
autofocusclass-attributeinstance-attribute
autofocus: bool = TrueWhether to request focus as soon as the map control appears (and to enable keyboard controls).
enable_arrow_keys_panningclass-attributeinstance-attribute
enable_arrow_keys_panning: bool = TrueWhether to allow arrow keys to pan the map (in their respective directions).
enable_qe_rotatingclass-attributeinstance-attribute
enable_qe_rotating: bool = TrueWhether 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_zoomingclass-attributeinstance-attribute
enable_rf_zooming: bool = TrueWhether 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_panningclass-attributeinstance-attribute
enable_wasd_panning: bool = TrueWhether 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_componentclass-attributeinstance-attribute
leap_max_of_curve_component: Number = 0.6The 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_velocityclass-attributeinstance-attribute
max_rotate_velocity: Number = 3The 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_velocityclass-attributeinstance-attribute
max_zoom_velocity: Number = 0.03The 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_multiplierclass-attributeinstance-attribute
pan_leap_velocity_multiplier: Number = 5The 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_durationclass-attributeinstance-attribute
perform_leap_trigger_duration: Optional[DurationValue] = 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_multiplierclass-attributeinstance-attribute
rotate_leap_velocity_multiplier: Number = 3The 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_multiplierclass-attributeinstance-attribute
zoom_leap_velocity_multiplier: Number = 3The 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
disabledclassmethod
disabled(cls)Disable keyboard control of the map.
CursorKeyboardRotationConfiguration may still be active, and is not disabled if this is disabled.