<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _on_key_press(self, widget, event):
 """Updates the currently pressed keys In addition, the sidebars are toggled if <Ctrl><Tab> is pressed. :param Gtk.Widget widget: The main window :param Gdk.Event event: The key press event """

        self.currently_pressed_keys.add(event.keyval)
        if event.keyval in [Gdk.KEY_Tab, Gdk.KEY_ISO_Left_Tab] and event.state & Gdk.ModifierType.CONTROL_MASK:
            self.toggle_sidebars()