<commit_before>#include "dispatcher_utility.hpp"
#include "hid_manager.hpp"

namespace {
class dump_hid_report final : public pqrs::dispatcher::extra::dispatcher_client {
public:
  dump_hid_report(const dump_hid_report&) = delete;

  dump_hid_report(void) : dispatcher_client() {
    std::vector<std::pair<krbn::hid_usage_page, krbn::hid_usage>> targets({
        std::make_pair(krbn::hid_usage_page::generic_desktop, krbn::hid_usage::gd_keyboard),
        std::make_pair(krbn::hid_usage_page::generic_desktop, krbn::hid_usage::gd_mouse),
        std::make_pair(krbn::hid_usage_page::generic_desktop, krbn::hid_usage::gd_pointer),
    });

    hid_manager_ = std::make_unique<krbn::hid_manager>(targets);

    hid_manager_->device_detected.connect([this](auto&& weak_hid) {
      if (auto hid = weak_hid.lock()) {
        hid->report_arrived.connect([this, weak_hid](auto&& type,
                                                     auto&& report_id,<commit_msg>support hid_usage_page::leds in dump_hid_report<commit_after>#include "dispatcher_utility.hpp"
#include "hid_manager.hpp"

namespace {
class dump_hid_report final : public pqrs::dispatcher::extra::dispatcher_client {
public:
  dump_hid_report(const dump_hid_report&) = delete;

  dump_hid_report(void) : dispatcher_client() {
    std::vector<std::pair<krbn::hid_usage_page, krbn::hid_usage>> targets({
        std::make_pair(krbn::hid_usage_page::generic_desktop, krbn::hid_usage::gd_keyboard),
        std::make_pair(krbn::hid_usage_page::generic_desktop, krbn::hid_usage::gd_mouse),
        std::make_pair(krbn::hid_usage_page::generic_desktop, krbn::hid_usage::gd_pointer),
        std::make_pair(krbn::hid_usage_page::leds, krbn::hid_usage::led_caps_lock),
    });

    hid_manager_ = std::make_unique<krbn::hid_manager>(targets);

    hid_manager_->device_detected.connect([this](auto&& weak_hid) {
      if (auto hid = weak_hid.lock()) {
        hid->report_arrived.connect([this, weak_hid](auto&& type,
                                                     auto&& report_id,
{'fraction_non_alphanumeric': 0.13907933398628794, 'fraction_numerical': 0.0, 'mean_word_length': 4.771186440677966, 'pattern_counts': {'":': 0, '<': 9, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '225679', 'n_tokens_mistral': 691, 'n_tokens_neox': 730, 'n_words': 80}