def color_list_keyboard_input_handling(self):
        """Keyboard input handling for the color list mode."""
        ### get a list of booleans representing flags for
        ### whether specific buttons are pressed or not
        pressed_keys = SERVICES_NS.get_pressed_keys()

        ### calculate whether we should scroll based on the
        ### state of specific buttons

        should_scroll = (
            ## whether a key to go up was pressed
            any(pressed_keys[i] for i in (K_w, K_UP))
            ## minus whether a key to go down was pressed
            - any(pressed_keys[i] for i in (K_s, K_DOWN))
        )

        ### if should_scroll is truthy (different than 0),
        ### it will be either 1 or -1, which indicates
        ### a direction to which to scroll;
        ### if such is the case, multiply the value by 20,
        ### scrolling by the resulting amount

        if should_scroll:
            self.scroll_color_list(should_scroll * 20)
Keyboard input handling for the color list mode.
nodezator/colorsman/viewer/modes/colorlist.py