<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend_selection():
 """Checks is the selection is to be extended The selection is to be extended, if a special modifier key (typically <Ctrl>) is being pressed. :return: If to extend the selection :rtype: True """

    from rafcon.gui.singleton import main_window_controller
    currently_pressed_keys = main_window_controller.currently_pressed_keys if main_window_controller else set()
    if any(key in currently_pressed_keys for key in [constants.EXTEND_SELECTION_KEY,
                                                     constants.EXTEND_SELECTION_KEY_ALT]):
        return True
    return False