Maps.cb.keypress.attach

class eomaps.eomaps.Maps.cb.keypress.attach(parent)

Attach custom or pre-defined callbacks on keypress events.

Each callback takes 1 additional keyword-arguments:

keystr or None

The key to use.

  • Modifiers are attached with a β€˜+’, e.g. β€œalt+d”

  • If None, the callback will be fired on any key!

For additional keyword-arguments check the doc of the callback-functions!

Examples

Attach a pre-defined callback:

>>> m.cb.keypress.attach.switch_layer(layer=1, key="1")

Attach a custom callback:

>>> def cb(**kwargs):
>>>     ... do something ...
>>>
>>> m.cb.keypress.attach(cb, key="3")

Members

fetch_layers

Fetch (and cache) layers of a map.

overlay_layer

Toggle displaying a layer on top of the currently visible layers.

switch_layer

Set the currently visible layer of the map.