def get_input(self, prompt: Optional[str] = None) -> Optional[str]:
        """Enhanced input handling with mouse scroll support"""
        try:
            if prompt:
                self.update_status(prompt)
            if not self.is_setup:
                self.setup()
            self.input_buffer = ""
            self._refresh_input_prompt()

            while True:
                if self.should_terminate.is_set():
                    return None

                try:
                    ch = self.input_win.getch()

                    if ch == curses.KEY_MOUSE:
                        try:
                            mouse_event = curses.getmouse()
                            # Ignore mouse events entirely for now
                            continue
                        except curses.error:
                            continue

                    if ch == 4:  # Ctrl+D
                        result = self.input_buffer.strip()
                        self.input_buffer = ""
                        if not result:
                            self.cleanup()
                            return "@quit"
                        return result

                    elif ch == 3:  # Ctrl+C
                        self.should_terminate.set()
                        self.cleanup()
                        return "@quit"

                    elif ch == ord('\n'):  # Enter
                        result = self.input_buffer.strip()
                        if result:
                            self.input_buffer = ""
                            return result
                        continue

                    elif ch == curses.KEY_BACKSPACE or ch == 127:  # Backspace
                        if self.input_buffer:
                            self.input_buffer = self.input_buffer[:-1]
                            self._refresh_input_prompt()

                    elif 32 <= ch <= 126:  # Printable characters
                        self.input_buffer += chr(ch)
                        self._refresh_input_prompt()

                except KeyboardInterrupt:
                    self.should_terminate.set()
                    self.cleanup()
                    return "@quit"
                except curses.error:
                    self._refresh_input_prompt()

        except Exception as e:
            logger.error(f"Error in get_input: {str(e)}")
            self.should_terminate.set()
            self.cleanup()
            return "@quit"
Enhanced input handling with mouse scroll support
research_manager.py