<commit_before>#include <swears/input.hpp>

#include <ncurses.h>
#include <sys/select.h>
#include <unistd.h>

using namespace Swears;

Input::Input(Window &win)
{
    //::keypad(win, true);
    ::nodelay(win, true);
}

int Input::read(void)
{
    return getch();
}

bool Input::has_input(void)
{
    fd_set readfds;
    auto timeout = timeval{0,0};
    FD_ZERO(&readfds);
    FD_SET(STDIN_FILENO, &readfds);

    return static_cast<bool>(select(STDIN_FILENO+1, &readfds, nullptr, nullptr, &timeout));
}<commit_msg>Keypad mode set<commit_after>#include <swears/input.hpp>

#include <ncurses.h>
#include <sys/select.h>
#include <unistd.h>

using namespace Swears;

Input::Input(Window &win)
{
    ::keypad(win, true);
    ::nodelay(win, true);
}

int Input::read(void)
{
    return getch();
}

bool Input::has_input(void)
{
    fd_set readfds;
    auto timeout = timeval{0,0};
    FD_ZERO(&readfds);
    FD_SET(STDIN_FILENO, &readfds);

    return static_cast<bool>(select(STDIN_FILENO+1, &readfds, nullptr, nullptr, &timeout));
}
{'fraction_non_alphanumeric': 0.16731517509727625, 'fraction_numerical': 0.005836575875486381, 'mean_word_length': 4.748603351955308, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '599959', 'n_tokens_mistral': 426, 'n_tokens_neox': 413, 'n_words': 76}