{
    "content": [
        {
            "type": "text",
            "text": "# POE::Wheel::Curses (perldoc)\n\n## NAME\n\nPOE::Wheel::Curses - non-blocking input for Curses\n\n## SYNOPSIS\n\nuse Curses;\nuse POE qw(Wheel::Curses);\nPOE::Session->create(\ninlinestates => {\nstart => sub {\n$[HEAP]{console} = POE::Wheel::Curses->new(\nInputEvent => 'gotkeystroke',\n);\n},\ngotkeystroke => sub {\nmy $keystroke = $[ARG0];\n# Make control and extended keystrokes printable.\nif ($keystroke lt ' ') {\n$keystroke = '<' . uc(unctrl($keystroke)) . '>';\n}\nelsif ($keystroke =~ /^\\d{2,}$/) {\n$keystroke = '<' . uc(keyname($keystroke)) . '>';\n}\n# Just display it.\naddstr($keystroke);\nnoutrefresh();\ndoupdate;\n# Gotta exit somehow.\ndelete $[HEAP]{console} if $keystroke eq \"<^C>\";\n},\n}\n);\nPOE::Kernel->run();\nexit;\n\n## DESCRIPTION\n\nPOE::Wheel::Curses implements non-blocking input for Curses programs.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PUBLIC METHODS** (2 subsections)\n- **EVENTS AND PARAMETERS** (1 subsections)\n- **SEE ALSO**\n- **BUGS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "POE::Wheel::Curses",
        "section": "",
        "mode": "perldoc",
        "summary": "POE::Wheel::Curses - non-blocking input for Curses",
        "synopsis": "use Curses;\nuse POE qw(Wheel::Curses);\nPOE::Session->create(\ninlinestates => {\nstart => sub {\n$[HEAP]{console} = POE::Wheel::Curses->new(\nInputEvent => 'gotkeystroke',\n);\n},\ngotkeystroke => sub {\nmy $keystroke = $[ARG0];\n# Make control and extended keystrokes printable.\nif ($keystroke lt ' ') {\n$keystroke = '<' . uc(unctrl($keystroke)) . '>';\n}\nelsif ($keystroke =~ /^\\d{2,}$/) {\n$keystroke = '<' . uc(keyname($keystroke)) . '>';\n}\n# Just display it.\naddstr($keystroke);\nnoutrefresh();\ndoupdate;\n# Gotta exit somehow.\ndelete $[HEAP]{console} if $keystroke eq \"<^C>\";\n},\n}\n);\nPOE::Kernel->run();\nexit;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 35,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "PUBLIC METHODS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "new",
                        "lines": 3
                    },
                    {
                        "name": "new",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "EVENTS AND PARAMETERS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "InputEvent",
                        "lines": 11
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "POE::Wheel::Curses - non-blocking input for Curses\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Curses;\nuse POE qw(Wheel::Curses);\n\nPOE::Session->create(\ninlinestates => {\nstart => sub {\n$[HEAP]{console} = POE::Wheel::Curses->new(\nInputEvent => 'gotkeystroke',\n);\n},\ngotkeystroke => sub {\nmy $keystroke = $[ARG0];\n\n# Make control and extended keystrokes printable.\nif ($keystroke lt ' ') {\n$keystroke = '<' . uc(unctrl($keystroke)) . '>';\n}\nelsif ($keystroke =~ /^\\d{2,}$/) {\n$keystroke = '<' . uc(keyname($keystroke)) . '>';\n}\n\n# Just display it.\naddstr($keystroke);\nnoutrefresh();\ndoupdate;\n\n# Gotta exit somehow.\ndelete $[HEAP]{console} if $keystroke eq \"<^C>\";\n},\n}\n);\n\nPOE::Kernel->run();\nexit;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "POE::Wheel::Curses implements non-blocking input for Curses programs.\n\nPOE::Wheel::Curses will emit an \"InputEvent\" of your choosing whenever an input event is\nregistered on a recognized input device (keyboard and sometimes mouse, depending on the curses\nlibrary). Meanwhile, applications can be doing other things like monitoring network connections\nor child processes, or managing timers and stuff.\n",
                "subsections": []
            },
            "PUBLIC METHODS": {
                "content": "POE::Wheel::Curses is rather simple.\n\nnew",
                "subsections": [
                    {
                        "name": "new",
                        "content": "watcher for STDIN (via selectread()) and registers an internal handler to preprocess\nkeystrokes.\n"
                    },
                    {
                        "name": "new",
                        "content": "the wheel will emit whenever there is input on the console or terminal. As with all wheels, the\nevent will be sent to the session that was active when the wheel was constructed.\n\nIt should be noted that an application may only have one active POE::Wheel::Curses object.\n"
                    }
                ]
            },
            "EVENTS AND PARAMETERS": {
                "content": "These are the events sent by POE::Wheel::Curses.\n",
                "subsections": [
                    {
                        "name": "InputEvent",
                        "content": "\"InputEvent\" defines the event that will be emitted when POE::Wheel::Curses detects and reads\nconsole input. This event includes two parameters:\n\n$[ARG0] contains the raw keystroke as received by Curses::getch(). An application may process\nthe keystroke using Curses::unctrl() and Curses::keyname() on the keystroke.\n\n$[ARG1] contains the POE::Wheel::Curses object's ID.\n\nMouse events aren't portable. As of October 2009, it's up to the application to decide whether\nto call mousemask().\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "Curses documents what can be done with Curses. Also see the man page for whichever version of\nlibcurses happens to be installed (curses, ncurses, etc.).\n\nPOE::Wheel describes wheels in general.\n\nThe SEE ALSO section in POE contains a table of contents covering the entire POE distribution.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "None known, although curses implementations vary widely.\n\nAUTHORS & COPYRIGHTS\nPlease see POE for more information about authors and contributors.\n",
                "subsections": []
            }
        }
    }
}