

def _key_press(event, params):
    'Function for handling key presses for the animation.'
    if (event.key == 'left'):
        params['pause'] = True
        params['frame'] = max((params['frame'] - 1), 0)
    elif (event.key == 'right'):
        params['pause'] = True
        event['frame'] = min((params['frame'] + 1), (len(params['frames']) - 1))

dataset/ETHPy150Open mne-tools/mne-python/mne/viz/topomap.py _key_press/VarMisuse@70/104 `params`->`event`